1) Write an if statement that prints the message "The number is not valid" if the variable speed is outside the range of 0 through 30. 2) Write an if statement that prints the message "The number is not valid" if the variable speed is within the range of 0 through 30. 3) Write one or more C++ statements that will print on the screen the value of a float variable burger_charge with a dollar sign and two decimal places after the words: "The total amount of burger is." 4) Write one or more C++ statements that will multiply the variable number_of_chips by the constant chip_price and put the result in the variable chip_total.
Added by Claudia L.
Step 1
1) If statement to check if speed is outside the range of 0 through 30: ``` if (speed < 0 || speed > 30) { cout << "The number is not valid" << endl; } ``` Show more…
Show all steps
Your feedback will help us improve your experience
Nick Collins and 65 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a working program in C++ for the following: The state university charges $190.00 for each semester hour of credit, $400 per semester for a regular double room, $550 per semester for a single room, and $500 per semester for food. All students are charged a $30 matriculation fee. Graduation students must also pay a $35 diploma fee. Write a program to compute the fees that must be paid by a student. Your program should include an appropriate warning message if a student is taking more than 21 credit hours or fewer than 12 credit hours. A typical line of data for one student would include a room type (R or S), student number (four-digit integer), number of credit hours, and a graduating flag (T or F)
Supreeta N.
Write a C++ program that inputs a string, integer, and float type and then outputs the values
Akash M.
Write a C++ statement that prints the message "The number is valid." if the variable temperature is within the range -50 through 150.
Willis J.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD