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
What is a router in computer networks?
grigory [225]
A router forwards data pacomputer software<span> that decides how to forward data packets between networks efficiently. </span>
4 0
4 years ago
I need the answers. i don’t get this
bixtya [17]
Run,lazy,turtles,slow,wandering, jump,45,weird,pigs, cows, cousins, pale,rude,candles

There are many answers for this but this is what first came to my mind

Hope this helps
4 0
3 years ago
RBTs are likely to be the ABA professionals who are implementing skills acquisition plans. In order to prepare and plan for a se
arlik [135]

Answer:

review session notes from the previous session, and decide how to proceed with the current session

Explanation:

RBTs are registered behaviour technicians who could also function as Adaptive behavior assessment professionals. RBTs often help their clients increase their skill level. This is done through the application of the skill acquisition plan. The skill acquisition plan includes such things as the : skill deficit, goal to tackle deficit, data measurement systems etc. In order to have a successful session, RBTs should check and review session notes for previous exercise and from there plan how to proceed with new session.

7 0
3 years ago
The "c" key and the "e" key are struck by
adoni [48]
1 because when you type on the home row your left middle finger will hit both of those letters.
3 0
3 years ago
Read 2 more answers
How many report charts can be added to the account page layout to meet this requirement? A sales manager would like to look at a
Virty [35]

Answer:

D - 2

Explanation:

You can have two report charts per page. You can only add report charts from the enhanced page layout editor.

The mini console and the original page layout editor are not supported. On detail pages, users can refresh up to 100 report charts every 60 minutes. Your organization can refresh up to 3,000 report charts every 60 minutes

8 0
3 years ago
Other questions:
  • A mobile device is freezing almost daily. The device remains powered on and the screen illuminated. The user restarts the device
    13·1 answer
  • What does CRM stand for?
    10·1 answer
  • It is always safe to enter personal information into a pop-up window. true or false.
    13·1 answer
  • Write a Unix (Linux) find-like command (myFind) in Python3 where the function will return the full paths of all the files contai
    9·1 answer
  • What does the following code segment do?
    13·1 answer
  • How to write conclusion of hard disk​
    11·1 answer
  • Explain the working principal of computer system with suitable diagarm​
    9·1 answer
  • Everyone say bye to brainly cause I’m reporting it for being against the law
    10·2 answers
  • Will creates an entry in his calendar and marks it as an all-day instance. Which item has he created?
    10·1 answer
  • 4.8.4 Better Sum
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!