C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 2, Problem 2.33MD
Program Plan Intro
1.total_amount,tolls_tax,miles,mpg,gas_Cost, parking_Fee variables are used for inputs.
Program Description:
The main purpose of the program is to calculate the driving cost of per day.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Strings) Exercise-Displaying Values
Exercise: Displaying Values
You may recall from an earlier playground an exercise that involved calculating the space remaining on an iPhone. You had the following information:
The capacity of an iPhone is measured in gigabytes (GB). The iPhone in question has 8GB of storage.
A gigabyte is about 1,000 megabytes (MB)
The phone already has 3GB of stuff on it
One minute of video takes 150MB of space
Exercise
Create a string that tells the user how many minutes of video they can store on the phone. You'll first need to perform the calculation steps, then use string interpolation
to display the answer - which should look like this:
You can record XXX more minutes of video.
Hint: Do all of your calculations in megabytes.
17
18
19
20
21
22
Perlin Noise
What scale factor must be applied to Perlin noise in order that the resulting noise
fully occupy the range [0, 1]? Assume that a = b = 4 and that 3 levels of noise are
summed, and that the original noise is in the range [0,1].
The scale factor divides the Perlin noise sum (e.g. a scale factor of 2 would divide the
sum by 2).
Enter an exact decimal number, incl(Alt + A) y necessary digits after the decimal
point.
Determine the value of the following arithmetic expression.
floor(5.8)
Chapter 2 Solutions
C How to Program (8th Edition)
Ch. 2 - Identify and correct the errors in each of the...Ch. 2 - Fill in the blanks in each of the following: _____...Ch. 2 - Write a single C statement or line that...Ch. 2 - State which of the following are true and which...Ch. 2 - Prob. 2.11ECh. 2 - What, if anything, prints when each of the...Ch. 2 - Which, if any, of the following C statements...Ch. 2 - Given the equation y=ax3+7, which of the...Ch. 2 - State the order of evaluation of the operators in...Ch. 2 - (Arithmetic) Write a program that asks the user to...
Ch. 2 - (Printing Values with print!) Write a program that...Ch. 2 - (Comparing Integers) Write a program that asks the...Ch. 2 - (Arithmetic, Largest Value and Smallest Value)...Ch. 2 - (Diameter, Circumference and Area of a Circle)...Ch. 2 - Prob. 2.21ECh. 2 - What does the following code print? printf( *\n) ;Ch. 2 - (Largest and Smallest Integers) Write a program...Ch. 2 - (Odd or Even) Write a program that reads an...Ch. 2 - Print your initials in block letters down the...Ch. 2 - (Multiples) Write a program that reads in two...Ch. 2 - (Checkerboard Pattern of Asterisks) Display the...Ch. 2 - Prob. 2.28ECh. 2 - (Integer Value of a Character) Heres a peek ahead....Ch. 2 - (Separating Digits in an Integer) Write a program...Ch. 2 - (Table of Squares and Cubes) Using only the...Ch. 2 - (Body Mass Index Calculator) We introduced the...Ch. 2 - Prob. 2.33MD
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
- Python programming language You will be creating an application to calculate the maximum amount of contribution a person can make to a Roth IRA based on their age and income. Over 50 years old and your contribution limit goes up from $6000 to $7000 dollars. However, if the person is married and the combined household income is over $206,000 a year, or a single person with income over $139,000, you are not allowed to contribute. Write an application that asks the user their age and their income. Using this information use a nested if statement to calculate the maximum allowable contribution.arrow_forwardQuestion Kk code on expo)Code a home screen that displays details about the last book the user has read. You can use state to store information about the last book read, and use the text component to display that information on the screen.arrow_forwardneed java code Imagine you have just purchased your first home. As your first house project, you have decided on adding a fence in your backyard. You have contacted several local contractors and receive their project bids (estimated cost) and rating (out of 5 stars). These bids will be provided by up to five different contractors. In order to perform the evaluation, your application should select the winning bid with the highest rating and the lowest cost within your budget. If there are two or more bids with the highest rating and the lowest cost within your budget, then both bids should be selected. Create a modular solution to enable you to first enter your budget for the project. Then, the solution should allow you to enter each bid, one at a time, until all bids have been entered. If you enter an incorrect bid, the program should provide an error message and a chance to enter the bid again. Once all bids have been entered, the winning bid should be determined. The winning bid…arrow_forward
- Computer Science Create an GUI application that lets the user enter four integers and displays in textboxes largest and smallest of the given numbers. (python codearrow_forwardC language The program should allow users to add, subtract, multiply, and divide fractions. The program should display a menu and prompt the user for a mathematical operation, until they enter 5 to exit. The menu should give the user the option to add, subtract, multiply or divide fractions, or exit. After the user chooses their option, they should be prompted to input two fractions. The result of the arithmetic should then be displayed to the screen. Requirements main()Functionality: This main function should prompt the user for a menu option until they enter 5. If the user doesn't choose Option 5 to end the program, it should get two fractions from the user. It should decide, based on the menu option which actions to perform on the fractions. Option 1 adds the two fractions together. Option 2 subtracts the first fraction from the second. Option 3 multiplies the two fractions together. Option 4 divides the first fraction by the second one. In addition to the main functions, your…arrow_forwardGreenLawn a local lawn care company has different pricing policies for its customers. GreenLawn sends out monthly invoices and will give discounts if payments are made within 5 days. The discounting policy is as follow: If the amount of the monthly bill is greater than $300, subtract 4 percent from the invoice; if the amount is between $300 and $100, subtract a 2-percent discount; if the amount is less than $100, do not apply any discount. All bills made via the web automatically receive an extra 3-percent discount. Develop a decision for GreenLawn discounting decisions. Decision Table submission: Include the initial table with all rules, and the most simplified table. Use different colors in the columns to easily show how columns are collapsed/simplified. please do not provideo solution in image format thank you!arrow_forward
- Savings Account The following steps calculate the balance after three years when $100 isdeposited in a savings account at 5% interest compounded annually:1. Declare the variable balance as type Decimal.2. Assign the value 100 to the variable balance.3. Increase the variable balance by 5% of its value. (Write 5% as 0.05D.)4. Increase the variable balance by 5% of its value.5. Increase the variable balance by 5% of its value.6. Display the value of balance (rounded to two decimal places) in a list box.arrow_forwardPYTHON PROGRAMMING!! EXTRA CONSTRAINT: MAKE SURE THAT THE CODE ACCEPTS THE INPUT ON THE IMAGE AND OUTPUTS THE RESULT ON THE IMAGE AS WELLYou find yourself in a top-secret mission to infiltrate and disable the nuclear missile silos of a terrorist organization threatening to destroy any country that refuses to surrender. Fortunately, an ally double agent was able to successfully hijack the launch system used by the terrorists. However, in order to not get found out, they could not disable the system outright but they were able to infect the system with an undetectable virus that stops all processes of the system was activated. Through a secure line, the double agent gives you the instructions in order to activate the virus and stop all missiles from firing: In the trash can nearest the main computer, you should be able to get a crumpled piece of paper with a grid of random numbers printed onto it. You will know that it is the right piece of paper if there are the same number of rows and…arrow_forwardStrict Warning ⚠️ don't you dare useany AI tool otherwise I'll report your accountarrow_forward
- - Calculate Income Tax Problem Statement A program is required to determine to calculate the amount of Virginia State Income tax a person will pay. The user will enter their annual income. The Virginia income tax rate is 5.75%. Display the amount of tax they need to pay.arrow_forwardThe output of a calculation is often shown in the user interface in the form of a(n) _____control.arrow_forwardFlowchart You need to develop a solution for a drone surveillance system. The system must implement the following rules: The system uses three drones but only one drone will fly at any given time. When the drones are at rest (in their 'home' location) they sit on a recharging station and can fully charge a battery in 30 minutes (the charger will automatically turn off when the battery is fully charged). A drone's battery life lasts up to 40 minutes of flight time. The surveillance system operates 24 hours a day, 7 days a week. The flight path is preprogrammed using a set of GPS coordinates and does not need to be programmed in your solution. A drone will follow the flight path continuously (circling) until the battery has just enough power remaining to return to the 'home' location to recharge. When a drone returns to the 'home' location, it seats itself in the charger, and another drone (one that has the most charge) will automatically launch and repeat the cycle. During the…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education