The following pseudocode
area = width × length
Display “What is the room’s width?”
Input width
Display “What is the room’s length?”
Input length
Display area
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Starting out with Visual C# (4th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Modern Database Management (12th Edition)
Starting Out with Java: Early Objects (6th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Starting Out with C++: Early Objects
- pythonarrow_forwardUsing C++ languagearrow_forward(Computation) A magic square is a square of numbers with N rows and N columns, in which each integer value from 1 to (N * N) appears exactly once, and the sum of each column, each row, and each diagonal is the same value. For example, Figure 7.21 shows a magic square in which N=3, and the sum of the rows, columns, and diagonals is 15. Write a program that constructs and displays a magic square for a given odd number N. This is the algorithm:arrow_forward
- (Simulation) Write a program to simulate the roll of two dice. If the total of the two dice is 7 or 11, you win; otherwise, you lose. Embellish this program as much as you like, with betting, different odds, different combinations for win or lose, stopping play when you have no money left or reach the house limit, displaying the dice, and so forth. (Hint: Calculate the dots showing on each die with the expression dots=(int)(6.0randomnumber+1), where the random number is between 0 and 1.)arrow_forward24. A piece of wire is to be bent in the form of a rectangle to put around a picture frame. The length of the picture frame is 1.5 times the width. Write a program that prompts the user to input the length of the wire and outputs the length and width of the picture frame.arrow_forwardWhat is the answer to this algorithmarrow_forward
- The formulas for calculating BMI are B M I = 703 ⋅ w e i g h t I n P o u n d s/ h e i g h t I n I n c h e s 2 or B M I = w e i g h t I n K i l o g r a m s /h e i g h t I n M e t e r s 2 Create a BMI calculator that reads the user’s weight and height (providing an option for the user to select which formula to use), and then calculates and displays the user’s body mass index. Also, display the BMI categories and their values from the National Heart Lung and Blood Institute: http://www.nhlbi.nih.gov/health/educational/lose_wt/BMI/bmicalc.htm (Links to an external site.) so the user can evaluate his/her BMI.arrow_forwardThe area of a pentagon can be computed using the following formula (s is the length of a side): Area = ( 5 * s2 ) / ( 4 * tan( π/5 ) Write a program that prompts the user to enter the side of a pentagon and displays the area.arrow_forwardFind the error in the pseudocode example listed below: Declare real lowest, highest, average (this is not the error) Display "Enter the lowest score" Input lowest Display "Enter the highest score" Input highest Set average = lowest + highest / 2 Display "The average is ", average, "."arrow_forward
- Design an algorithm that prompts the user to enter his or her favorite color and stores the user’sinput in a variable named color.arrow_forwardWhat is the answer to this algorithmarrow_forwardIn computer-based problems, you must define the Inputs and the Outputs at the start. True False The value that can be changed during the execution of the program is referred to as: Constant Float Variable Integerarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT