Absolute C++
6th Edition
ISBN: 9780133970784
Author: Walter Savitch, Kenrick Mock
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 1, Problem 13PP
Scientists estimate that consuming roughly 10 grams of caffeine at once is a lethal overdose. Write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
4. Write a Phyton program that computes the speed of sound (a) in air of a given temperature T
(°F ). Use the formula
5T+2297
2457
a = 10861
In order to discourage excess electric
consumption, an electrical company charges
its customers a lower rate of P75 for the first
250 kilowatt-hours and a higher rate of P8.5 for
each additional kilowatt-hour. In addition, a
10% surtax is added to the final bill. Write a
program that calculates the electrical bill given
the number of kilowatt-hours consumed as
input. At the end, print the number of kilowatt-
hours consumed and the computed bill.
For example:
Input Result
200
Kilowatt -hours:
200
Electric bill: Php 82.50
260
Kilowatt-hours: 260
Electric bill: Php 176.00
Write a program to get an integer input from the
user.
If the input is 25, take the length and breadth from
the user and calculate the area of rectangle. [ Area
of rectangle = length * breadth ]
If the input is 40, get the side from the user and
calculate the area of square. [ Area of square =
side * side ]
If the input is 65, get the radius from the user and
calculate the area of circle. [ Area of circle =
3.14*r*r]
Otherwise Display " Enter number 25 or 40 or 65 ".
Chapter 1 Solutions
Absolute C++
Ch. 1 - A metric ton is 35,273.92 ounces. Write a program...Ch. 1 - A government research lab has concluded that an...Ch. 1 - Workers at a particular company have won a 7.6 pay...Ch. 1 - Negotiating a consumer loan is not always...Ch. 1 - Write a program that determines whether a meeting...Ch. 1 - Prob. 6PPCh. 1 - One way to measure the amount of energy that is...Ch. 1 - The Babylonian algorithm to compute the square...Ch. 1 - The video game machines at your local arcade...Ch. 1 - Write a program that allows the user to enter a...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Determine the reactions at the supports A and B, then draw the shear and moment diagrams. El is constant.
Mechanics of Materials (10th Edition)
The data shown in the following graph was collected during testing of an electromagnetic mass driver. The energ...
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
This optional Google account security feature sends you a message with a code that you must enter, in addition ...
SURVEY OF OPERATING SYSTEMS
The handle of the hammer is subjected to the force of F = 20 lb. Determine the moment of this force about the p...
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Write an SQL query to list each customer who bought at least one product that belongs to product line Basic in ...
Modern Database Management
Sum of Digits in a String Design a program that asks the user to enter a string containing a series of single d...
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Based on the image below, write a Phyton program that computes the speed of sound (a) in air of a given temperature T(℉) using the formula given.arrow_forwardA mass m is attached to the end of a rope of length r 3 meters. The rope can only be whirled around at speeds of 1, 10, 20, or 40 meters per second. The rope can with stand a maximum tension of T = 60 Newtons. Write a program where the user enters the value of the mass m, and the program determines the greatest speed at which it can be whirled without breaking the rope. Assume that the mass m is less than 100 kg. Hint: T = mv2 /r. Drop Your Code here: #Set the rope length #Set the maximum tension #Set the message #Read the mass value #Set a list of possible rotation speed #Set the size of the list Drag your statements from the following choices: length = 3 max_tension = 60 message = "The greatest speed without breaking the rope is:" mass = float(input(">>>Enters the value of the mass m: ")) rotation_speed - [1. 10, 20, 40] N= len(rotation_speed) pos - N-1 for i in range (N): tension = mass"rotation_speed[i)*2/length if tension>max tension: pos i-1 break…arrow_forwardA driver will be fined P500 if his speed goes beyond 80 kph and P800 if it goes beyond 100 kph. Make a program that would input the car's SPEED and output his FINE. For example: Input Result 20 No Fine 90 Fine is Php 500 120 Fine is Php 800arrow_forward
- USE PYTHON A small shop sells 280 different items. Each item is identified by a 3 – digit code. All items that start with a zero (0) are cards, All items that start with a one (1) are sweets, All items that start with a two (2) are stationery and All items that start with a three (3) are toys. Write a program which inputs the 3 – digit code for all 280 items and outputs the number of cards, sweets, stationery and toys.arrow_forwardA driver will be fined P500 if his speed goes beyond 80 kph and P800 if it goes beyond 100 kph. Make a program that would input the car's SPEED and output his FINE. For example: Input Result 20 0.00 90 500.00 120 800.00arrow_forward. Write a program that generates and prints 50 random integers, each between 3 and 6. .Write a program that generates a random number, x, between 1 and 50, a random number y between 2 and 5, and computes x". .Write a program that generates a random number between 1 and 10 and prints your name that many times. .Write a program that generates a random decimal number between 1 and 10 with two decimal places of accuracy. Examples are 1.23, 3.45, 9.80, and 5.00.arrow_forward
- You are working on a ticketing system. A ticket costs $10. The office is running a discount campaign: each group of 5 people is getting a discount, which is determined by the age of the youngest person in the group. You need to create a program that takes the ages of all 5 people as input and outputs the total price of the tickets. Sample Input: 55 28 15 38 63 Sample Output: 42.5 The youngest age is 15, so the group gets a 15% discount from the total price, which is $50 - 15% = $42.5 The given code is declaring an array of 5 elements and taking them from input using a loop.arrow_forwardWrite a program in Python where the user inputs the number of hours a person worked, and the program will calculate the person's salary. If the hours worked are less than or equal to 40, then the person receives 200 dollars per hour. If the hours worked are greater than 40, then the person receives 8000 dollars plus 300 dollars for each hour worked over 40 hours.arrow_forwardWrite a program that takes an integer number between 0 to 100 as input and outputs one of the following: The entered number XXX is Small The entered number XXX is Medium The entered number XXX is Big The entered number XXX is Huge (Where XXX should be the input number) 0 - 25 are considered small 26 - 50 are considered medium 51 - 75 are considered big 76 - 100 are considered huge Any other number should be rejected. Ex: If the input is: 64 the output is: The entered number 64 is Bigarrow_forward
- One acre of land is equivalent to 43,560 square feet. Write a program that calculates the number of acres in a tract of land with 389,767 square feet.arrow_forwardWrite a python program of the following using the modification of the second picturearrow_forwardGiven the sample code above in generating a random number. Create a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don't display the computer's choice yet.) 2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer.) 13. The computer's choice is displayed. 4. A winner is selected according to the following rules: a. If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) b. If one player chooses scissors and the other player chooses paper, then scissor wins. (Scissors cuts paper.) c. If one player chooses paper and the other player…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY