Concept explainers
Ocean Levels
Assuming the ocean’s level is currently rising at about 1.5 millimeters per year, write a
• The number of millimeters higher than the current level that the ocean’s level will be in 5 years.
• The number of millimeters higher than the current level that the ocean’s level will be in 7 years.
• The number of millimeters higher than the current level that the ocean’s level will be in 10 years.
Learn your wayIncludes step-by-step video
Chapter 2 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects
Starting Out With Visual Basic (8th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Modern Database Management (12th Edition)
Digital Fundamentals (11th Edition)
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }arrow_forwardPython code easy way pleasearrow_forwardA dramatic theater has three seating sections, and it charges the following prices for tickets in each section: section A seats cost $20 each, section B seats cost $15 each, and section C seats cost $10 each. The theater has 300 seats in section A, 500 seats in section B, and 200 seats in section C. Design a program that asks for the number of tickets sold in each section and then displays the amount of income generated from ticket sales. The program should validate the numbers that are entered for each section. Make sure to generalize the process so that a theater can have any number of sectionsarrow_forward
- A dramatic theater has three seating sections, and it charges the following prices for tickets in each section: section A seats cost $20 each, section B seats cost $15 each, and section C seats cost $10 each. The theater has 300 seats in section A, 500 seats in section B, and 200 seats in section C. Design a program that asks for the number of tickets sold in each section and then displays the amount of income generated from ticket sales. The program should validate the numbers that are entered for each section. please do pseudocode in c++arrow_forwardA dramatic theater has three seating sections, and it charges the following prices for tickets in each section: section A seats cost $20 each, section B seats cost $15 each, and section C seats cost $10 each. The theater has 300 seats in section A, 500 seats in section B, and 200 seats in section C. Design a program that asks for the number of tickets sold in each section and then displays the amount of income generated from ticket sales. The program should validate the numbers that are entered for each section. it should be in c++arrow_forwardA dramatic theater has three seating sections, and it charges the following prices for tickets in each section: section A seats cost $20 each, section B seats cost $15 each, and section C seats cost $10 each. The theater has 300 seats in section A, 500 seats in section B, and 200 seats in section C. Design a program that asks for the number of tickets sold in each section and then displays the amount of income generated from ticket sales. The program should validate the numbers that are entered for each section. please do the flowchart in c++ i also shared my source code so flowchart should match with source codearrow_forward
- A car’s miles-per-gallon (MPG) can be calculated with the following formula:MPG 5 Miles driven Gallons of gas usedWrite a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the car’s MPG and display the result.arrow_forwardThe program must calculate and display the amount to pay for tickets booked to travel from of departure to a destination. Example of how the program must work: Input: Enter the place of departure: Durban Enter the destination: Johannesburg Enter the price of one ticket: 989.45 Enter the number of tickets to be booked: 2 Output: A booking was made for 2 tickets From Durban to Johannesburg Total amount: R 1978.90 Another example: Enter the place of departure: Cape Town Enter the destination: Port Elizabeth Enter the price of one ticket: 78e.50 Enter the number of tickets to be booked: 3 A booking was made for 3 tickets From Cape Town to Port Elizabeth Total amount: R 2341.50arrow_forwardi need the answer quicklyarrow_forward
- Python Programming Only Please: Write a program that asks the user to enter a person’s age. The program should displaya message indicating whether the person is an infant, a child, a teenager, or an adult. Following are the guidelines: • If the person is 1 year old or less, he or she is an infant.• If the person is older than 1 year, but younger than 13 years, he or she is a child.• If the person is at least 13 years old, but less than 20 years old, he or she is a teenager.• If the person is at least 20 years old, he or she is an adult.arrow_forwardJoe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The program should perform the following steps: A) Ask the user for the diameter of the pizza in inches.B) Calculate the number of slices that may be taken from a pizza of that size if each slice has an area of 14.125 square inches.C) Display a message telling the number of slices.The number of square inches in the total pizza can be calculated with this formula:Area = πr2where variable r is the radius of the pizza and π is the Greek letter PI. In your program make PI a named constant with the value 3.14. Display the number of slices as a whole number (i.e., with no decimals).arrow_forwardoe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The program should perform the following steps: Ask the user for the diameter of the pizza in inches. Calculate the number of slices that may be taken from a pizza of that size. Display a message telling the number of slices. To calculate the number of slices that may be taken from the pizza, you must know the following facts: Each slice should have an area of 14.125 inches To calculate the number of slices, simply divide the area of the pizza by 14.125. The area of the pizza is calculated with this formula: Area NOTE: π is 3.14159. The variable r is the radius of the pizza. Divide the diameter by 2 to get the radius.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage