1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
leonid [27]
3 years ago
10

Copy the main given below. Write the methods needed to produce the output given. YOU SHOULD NOT CHANGE MAIN

Computers and Technology
1 answer:
Bad White [126]3 years ago
4 0

Answer:

C++ code explained below

Explanation:

CODE

#include <iostream>

using namespace std;

// prototypes go here

void getInput(double *l, double *w) {

cout << "Enter Length: ";

cin >> *l;

if(*l < 0) {

return;

}

cout << "Enter Width: ";

cin >> *w;

while(*w < 0) {

cout << "Width must be positive! Try Again" << endl;

cout << "Enter Width: ";

cin >> *w;

}

}

double calculations(double l, double w, double *perimeter) {

*perimeter = 2 * (l + w);

return l*w;

}

void printResults(double l, double w, double perimeter, double area) {

cout << "Rectangle Dimensions: " << l << " X " << w << endl;

cout << "perimeter: " << perimeter << endl;

cout << "Area: " << area << endl;

return;

}

int main()

{

double t;

// test(&t);

double length;

double width;

double perimeter;

double area;

//below line has to change if you need to work this example

//reason is length and width are local variable to main so other function can only change if address is passed so i have plase & sign before the variables while passing

//same has to be done for perimeter

getInput(&length, &width);

while (length >= 0)

{

area = calculations(length, width, &perimeter);

printResults(length, width, perimeter, area);

getInput(&length, &width);

}

}

You might be interested in
The winning design is typically that which most closely meets the design
zimovet [89]

when the when the when the add the when are you is id god his gay for your top off jack dafe cafe read line green red whats the answerAnswer:

when the when the when the add the when are you is id god his gay for your top off jack dafe cafe read line green red whats the answer

Explanation:

7 0
3 years ago
Emilee is watching an online video. The video is being sent to her laptop by a server over the Internet which splits the video i
Tresset [83]

Answer:

The answer is "Option C".

Explanation:The packet includes clients and modifies information both of these are often referred to as the payload. To achieve payload data by monitor data to get the control signals. It is a unit that will be an information material consisting of a specific network path into such a single packet and web browser transmissions and other types of networks will be used in the IP transmissions, in this, the data packet may arrive in out of order, and the wrong choice can be defined as follows:

  • In choice A, when the connection is good so, all the data is sent on the computer, that's why it is incorrect.
  • In choice B, It is wrong because it can't send back to the server.
  • In choice D, It can't be sent in order, that's why it is wrong.  
6 0
4 years ago
The program below is used to calcualte the sum of 3 numbers. There is an error in this program. Which line contains the error? n
djyliett [7]

Answer:

  1. num1=10
  2. num2 =20
  3. num3="30"
  4. sum = num1+num2+num3
  5. print (num1)
  6. print (num2)
  7. print (num3)
  8. print (sum)

The error is at line 3. The variable num3 has been assigned a string value with use of the quotes.

To fix the error, take away the quotes from the number 30, since the arithemetic operation cannot be carried out on the string in python program language.

Explanation:

5 0
3 years ago
Why are x-ray and gamma-ray telescopes in space?
creativ13 [48]
To observe ultraviolet, x-rays, gamma-rays or infrared, astronomers have had to put telescopes outside of Earth's atmosphere, normally in orbit around the Earth.
8 0
3 years ago
If you help with this i will give you something
irga5000 [103]

Help with what tho i dont seee anything

4 0
3 years ago
Read 2 more answers
Other questions:
  • I need help please?!!!!!!!!!
    15·1 answer
  • M f2.app.edmentum.com
    5·1 answer
  • What are the Components of a CPU?
    15·2 answers
  • A new employee has reported that print jobs are printing as garbled text. Which of the following is MOST likely the reason for t
    8·1 answer
  • Host to IP address lookup and its reverse lookup option are very important network services for any size network. It is also how
    9·1 answer
  • It is desirable to provide a degree of __________ __________ among classes so that one class is not adversely affected by anothe
    8·1 answer
  • Banks will pay you interest on your money based on the interest rate. True or false?​
    11·1 answer
  • This isn't academic, but what do I do if HI-REZ won't let me sign into an existing account. “Something went wrong” keeps popping
    5·1 answer
  • The Internet:
    12·1 answer
  • What type of block start a sequence?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!