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
Unit testing: Select one:
ser-zykov [4K]

Answer:

e. tests each program separately.

Explanation:

Unit testing -

It is one of the software testing where the individual units are tested , is referred to as unit testing.

The focus of this step is to scan each and every unit separately and thoroughly so as to avoid any type of damage or malfunctioning .

Hence, from the question, the correct statement for unit testing is e. tests each program separately.

5 0
3 years ago
What is the computer's main memory, which consists of the random access memory (ram), cache memory, and read-only memory (rom) t
Nata [24]
Hey there!

The main memory of a computer that includes RAM, ROM, and cached information that is accessible through the CPU is called primary storage. These memory/storage types deal directly with how the computer functions and runs. The other type of storage is called secondary storage and refers to storage that isn't directly connected to the CPU, such as the hard drive. 

Hope this helped you out! :-)
5 0
3 years ago
If my 98 dodge ram 1500 truck is dropping RPM's when i stop does that mean i need new throttle body sensors or does it mean i ne
geniusboy [140]
You might need a new 02 sensor and i really dont know about the vacuum leak.
6 0
3 years ago
Read 2 more answers
Why are mobile apps often easier to develop than desktop apps?
Karo-lina-s [1.5K]

Answer:

Mobile app creation platforms are available that reduce the need to code.

Explanation:

Simple app creation softwares and tools are all over the place for mobile app creation. To create a mobile app, no coding knowledge or experience is needed unlike desktops apps that requires the knowledge of some coding languages like python, JavaScript etc.

The availability of these softwares and platforms have made mobile apps creation easy.

6 0
3 years ago
Or operator of boolean algebra is denoted by:<br>*<br>+<br>-<br>.​
OlgaM077 [116]

Answer:

or operator is denoted by + sign

7 0
3 years ago
Other questions:
  • How is steering different from turning ? Need help //:
    13·1 answer
  • Select the correct answer.
    15·1 answer
  • Who is known as the father of computer? ​
    6·2 answers
  • Software on your computer is taking a long time to load. What could help solve this problem?
    5·1 answer
  • A filter is a camera accessory that is mounted on the optical path of the lens.<br> true or false
    6·2 answers
  • Consider the algorithm for determining whether a sequence of parentheses is balanced (has correct nesting). The pseudo code for
    10·1 answer
  • Selective colleges choose to have in-person meetings to learn more about the applicants. These meetings are called:
    8·2 answers
  • You have recently subscribed to an online data analytics magazine. You really enjoyed an article and want to share it in the dis
    9·1 answer
  • What are the constraints of mine shaft head gear​
    7·1 answer
  • How can you have internet without subscribing to cable?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!