Question

In: Computer Science

Write the pseudo code for this problem based on what you learned from the video. The...

Write the pseudo code for this problem based on what you learned from the video. The purpose is to design a modular program that asks the user to enter the length and width, and then calculates the area. The formula is as follows:

Area = Width x Length

Solutions

Expert Solution

input code:

output:

code:

#include <iostream>
using namespace std;

int main()
{
/*declare the variables*/
double length,width;
/*take user input*/
cout<<"Enter the length: ";
cin>>length;
cout<<"Enter the width: ";
cin>>width;
/*print output*/
cout<<"Area: "<<length*width;
return 0;
}

pseudocode:

main():

print("Enter the length")

length=take user input

print("Enter the width")

width=take user input

Area=length*width

print("Area",Area)

end


Related Solutions

Write a pseudo code program for a goal-based agent. The goal of the agent is to...
Write a pseudo code program for a goal-based agent. The goal of the agent is to find the exit of a labyrinth. The agent is not omniscient The agent can sense if it is next to a wall (in front, left or right) The agent can turn 90 degrees to the right or left The agent can drive 1unit forward The maze is constructed of paths that are 1 unit across (wide) Show a maze of your choosing and illustrate...
Write a Pseudo Code to send an Array of 20 elements from 8051 to the computer...
Write a Pseudo Code to send an Array of 20 elements from 8051 to the computer via serial port at maximum baud rate possible with XTAL=11.0592MHz.
Discuss two concepts that you learned from the video. 2. After watching this video, will you...
Discuss two concepts that you learned from the video. 2. After watching this video, will you be making any lifestyle modifications? 3. How do you feel about the 80/20 rule? 4. What is the difference between fasting, anorexia and bulimia nervosa? 5. List 3 sources of Omega 3 fatty acid.
What will be the expected output of the following pseudo code? Write exactly what would display...
What will be the expected output of the following pseudo code? Write exactly what would display when you execute the statements. Module main() Declare Integer a = 5 Declare Integer b = 2 Declare Integer c = 3 Declare Integer result = 0 Display "The value of result is" Display result Set result = a + b * c - a Display "Changed value is: ", result End Module
Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
Write pseudo-code to solve the following problem using MapReduce and explain how it works. Each line...
Write pseudo-code to solve the following problem using MapReduce and explain how it works. Each line in the file lists a user ID, the ID of the movie the user watched, the rating the user gave for the movie, and the timestamp. For example line 1 indicates that the user’s ID is 196, the movie ID is 242, the user gave this movie a rating of 3, and the timestamp is 881250949. Given the file, find out the top similar...
For the following program descriptions, write step by step pseudo code that shows you understand the...
For the following program descriptions, write step by step pseudo code that shows you understand the problem and what it takes to solve it. The first one is done for you as an example. Please answer the questions in the same format as the example problem below so it is the same. Example #1 Problem A customer is purchasing five items. Design a program where you collect the amount of each item, calculate the subTotal of the items, the tax...
1. Write an algorithm to calculate the Matrix multiplication (or write with pseudo code) 2. Write...
1. Write an algorithm to calculate the Matrix multiplication (or write with pseudo code) 2. Write an algorithm to calculate the recursive Matrix multiplication (or write with pseudo code) 3. Find the time complexity of your pseudo code and analyze the differences
Give a pseudo-code description for an array-based implementation of the deque ADT (Abstract Data Type). What...
Give a pseudo-code description for an array-based implementation of the deque ADT (Abstract Data Type). What is the running time for each operation?
A customer in a grocery store is purchasing three items. Write the pseudo code that will:...
A customer in a grocery store is purchasing three items. Write the pseudo code that will: • Ask the user to enter the name of the first item purchased. Then ask the user to enter the cost of the first item purchased. Make your program user friendly. If the user says the first item purchased is milk, then ask: “What is the cost of milk.” [This should work no matter what item is entered by the user. I might buy...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT