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
valina [46]
2 years ago
5

Define a function GetVolume() that takes one integer parameter passed by reference as totalCups and two integer parameters as ga

llons and cups. If both gallons and cups are non-negative, the function computes totalCups and returns true. Otherwise, the function returns false without updating totalCups.
Computers and Technology
1 answer:
Viefleur [7K]2 years ago
3 0

The computer program that takes one integer parameter is illustrated below.

<h3>What is a computer program?</h3>

A computer program is a set of instructions in a programming language for a computer to execute. A computer program in its human-readable form is called source code.

The program is illustrated below:

#include<iostream>

using namespace std;

void ConvertVolume(int totalTablespoons, int &cups, int &tablespoons) {

   // compute the cups and tablespoons

   // as they are passed by reference,

   // the change will also reflect in the main function

   cups = totalTablespoons / 16;

   tablespoons = totalTablespoons % 16;

}

int main() {

   int usrCups;

   int usrTablespoons;

   int totalTablespoons;

   

   // user input

   cin>>totalTablespoons;

   

   // call the function

   ConvertVolume(totalTablespoons, usrCups, usrTablespoons);

   

   // print the output

   cout<<usrCups<<" cups and "<<usrTablespoons<<" tablespoons"<<endl;

   

   return 0;

Learn more about programs on:

brainly.com/question/26642771

#SPJ1

You might be interested in
9. These particular machines can be decentralized.
shusha [124]

Answer:

A, B

Explanation:

Because the desktop computer and the printers are decentralized, they're connected with another noce in a company.. So I suppose that the Risograph and photocopier isn't decentralized.

4 0
3 years ago
Computer design replaced ______________
photoshop1234 [79]
The answer is c.-architectural talent and an eye for design.
4 0
4 years ago
Write a zip code class that encodes and decodes 5-digit bar codes used by the U.S. Postal Service on envelopes. The class should
8_murik_8 [283]

Answer:

#include<iostream>

#include<string>

using namespace std;

class zip_code

{

private:

int zipcode;

string get_string(int num)

{

string str="";

if(num == 0) return "11000";

if(num>7)

{

str.append("1");

num = num-7;

}

else

str.append("0");

if(num>4)

{

str.append("1");

num = num-4;

}

else

str.append("0");

if(num>2)

{

str.append("1");

num = num-2;

}

else

str.append("0");

if(num>1)

{

str.append("1");

num = num-1;

}

else

str.append("0");

str.append("0");

return str;

}

public:

zip_code(int barcode)

{

if(barcode<10000 || barcode>99999)

cout <<"Invalid Bar code passed to constructor." << endl;

else

zipcode = barcode;

}

zip_code(string barcode)

{

if(barcode.length()>27)

cout <<"Invalid Bar code passed to constructor." << endl;

else

{

int zipper = 0;

string str_local = barcode.substr(1,barcode.length()-2);

for(int i=0; i<str_local.length()-5; i+=5)

{

int local = 0;

local = 7*(str_local[i]-'0') +

       4*(str_local[i+1]-'0') +

       2*(str_local[i+2]-'0') +

       1*(str_local[i+3]-'0');

if(local == 11) local = 0;

       zipper = zipper*10 + local;

}

zipcode = zipper;

}

}

string getZipcode()

{

string str = "1";

int first = zipcode/10000;

int second = (zipcode - first*10000)/1000;

int third = (zipcode - first*10000-second*1000)/100;

int fourth = (zipcode - first*10000-second*1000-third*100)/10;

int fifith = (zipcode - first*10000-second*1000-third*100-fourth*10);

str.append(get_string(first));

str.append(get_string(second));

str.append(get_string(third));

str.append(get_string(fourth));

str.append(get_string(fifith));

str.append("1");

return str;

}

int get_zipCode()

{

return zipcode;

}

};

int main()

{

zip_code z1(123456);

zip_code z2(99504);

cout << z2.getZipcode() << endl;

system("pause");

return 0;

}

4 0
4 years ago
How can social media be used to find out about activities?
ICE Princess25 [194]
Hello RandomHacker


Using social media can inform you when events are happening near by. 

For example: Your favorite singer of band is going on tour and they are doing it near you, social media advertises this and you can find out in time to go.

Hope this helps
-Chris

3 0
3 years ago
Read 2 more answers
What is one way for an entrepreneur to decrease risk?
marysya [2.9K]

Answer

we can  decrease risk for an entrepreneur by creating a team of trusted advisors to rely on.

there are some points that we can take in mind know how  to position our company as a safe position.

revenue streams and additional technology, paving the way for future growth.

Entrepreneurs can use all these  unique strategies to decrease those risk

8 0
3 years ago
Other questions:
  • Collaboration, listening, and negotiating are considered _____ skills.
    5·1 answer
  • Footer is a text or graphis that print at the bottom of every page
    13·1 answer
  • What are the two types of computers
    15·2 answers
  • What's is the contribution of technology to the country?
    15·1 answer
  • Which of the following statements isNOT true about abstract data types (ADTs)?A list is anexample of an ADT.ADTs hide theimpleme
    7·1 answer
  • Sam wants to move across the text and his documents to add data at predefined stops. Which key will Hughes to navigate through t
    6·1 answer
  • Which search engine do you prefer? Why
    15·2 answers
  • The __________ utility has the capability to manage users, create and administer user groups, and apply user rights to those use
    8·1 answer
  • Can someone solve this for me please? It’s part of an escape room.
    13·2 answers
  • Which visual aid would be best for showing changes inacts population size over time?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!