URGENT HELP

profileBASNA

PLEASE REVIEW THE INFORMATION BELOW

  • 17 days ago
  • 10
files (1)

QUESTION1B.docx

Programming Laboratory Assignments 01B (suggested filename: <LastName>Prog01B.cpp

 

Instructions:

1. Write a C++ program that that computes the area of a rectangle, which is width * height.

2. Run the program and correct any errors that occur.

3. Test the program with different inputs.

 

An example of the program input and output is shown below:

       Display/Introduce (a message of) what the program will accomplish - such as 

     "This program will compute the area of a rectangle, given the width and height."

 Enter the width: 33

 Enter the height: 22

 

 The area is 726 square units.

SAMPLE HOW YOU HAVE TO DO THE ASSIGNMENT :

//Sample Program and Documentation for Prog01B.cpp. /**   * The LastnameProg01B.cpp program will compute the area of rectangle with width and height   * provided by the user as inputs.   *   * @filename: StudentLnameProg01B.cpp   * @author  StudentFname StudentLname   * @version 1.0   * @since   2023-10-20   */ //Header Files and/or preprocessors #include <stdio.h> #include <string> #include <iostream> #include <iomanip> using namespace std;   /** **********************************************************    * The program block below is the main() function which ‘Drives’ the program. This program block will    * compute the area of a rectangle given the width and height.    * a: Display a message for the user to indicate what the program is going to accomplish.    * b: Declare the variables - width, height, area (float)    * b: Request and get the two variables - width and height - from the user.    * c: Calculate the area using the inputs provided (area = width * height).    * d: Display the outputs, which includes area. Program ends.    *    * @param args Unused.    * @return Nothing is returned    */    int main() {       float width, height, area;       cout "This program computes the area of a rectangle with width and height provided by the user: " <<             endl << endl;       cout << "Enter the width of the rectangle: ";       cin >> width;       cout << "Enter the height of the rectangle: ";       cin >> height;       area = width * height; // calculate the area       cout << "With a width of " << width << " and a height of " << height <<           ", the area of the rectangle is: " << area << endl;           return 0;     } //****************************************************