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
IrinaK [193]
3 years ago
11

Business customers pay $0.006 per gallon for the first 8000 gallons. If the usage is more than 8000 gallons, the rate will be $0

.008 per gallon after the first 8000 gallons. For example, a residential customer who has used 9000 gallons will pay $30 for the first 6000 gallons ($0.005 * 6000), plus $21 for the other 3000 gallons ($0.007 * 3000). The total bill will be $51. A business customer who has used 9000 gallons will pay $48 for the first 8000 gallons ($0.006 * 8000), plus $8 for the other 1000 gallons ($0.008 * 1000). The total bill will be $56. Write a program to do the following. Ask the user which type the customer it is and how many gallons of water have been used. Calculate and display the bill.
Computers and Technology
1 answer:
trasher [3.6K]3 years ago
4 0

Answer:

#include <bits/stdc++.h>

using namespace std;

int main()

{

   // variables

   char cust_t;

   int no_gallon;

   double cost=0;

   cout<<"Enter the type of customer(B for business or R for residential):";

   // read the type of customer

   cin>>cust_t;

   // if type is business

   if(cust_t=='b'||cust_t=='B')

   {

       cout<<"please enter the number of gallons:";

       // read the number of gallons

       cin>>no_gallon;

       // if number of gallons are less or equal to 8000

       if(no_gallon<=8000)

       {

           // calculate cost

           cost=no_gallon*0.006;

           cout<<"total cost is: $"<<cost<<endl;

       }

       else

       {

           // if number of gallons is greater than 8000

           // calculate cost

           cost=(8000*0.006)+((no_gallon-8000)*0.008);

           cout<<"total cost is: $"<<cost<<endl;

           

       }

       

   }

   

   // if customer type is residential

   else if(cust_t=='r'||cust_t=='R')

        {

           

       cout<<"please enter the number of gallons:";

       // read the number of gallons

       cin>>no_gallon;

       // if number of gallons are less or equal to 8000

       if(no_gallon<=8000)

       {

           // calculate cost

           cost=no_gallon*0.007;

           cout<<"total cost is: $"<<cost<<endl;

       }

       else

       {// if number of gallons is greater than 8000

       // calculate cost

           cost=(8000*0.005)+((no_gallon-8000)*0.007);

           cout<<"total cost is: $"<<cost<<endl;      

       }        

   }

return 0;

}

Explanation:

Ask user to enter the type of customer and assign it to variable "cust_t". If the customer type is business then read the number of gallons from user and assign it to variable "no_gallon". Then calculate cost of gallons, if  gallons are less or equal to 800 then multiply it with 0.006.And if gallons are greater than 8000, cost for  first 8000 will be multiply by 0.006 and  for rest gallons multiply with 0.008.Similarly if customer type is residential then for first 8000 gallons cost will be multiply by 0.005 and for rest it will  multiply by 0.007. Then print the cost.

Output:

Enter the type of customer(B for business or R for residential):b                                                                                            

please enter the number of gallons:9000                                                                                                                      

total cost is: $56  

You might be interested in
Which type of software is used for marketing research as a way to find out about users' preferences?
kogti [31]

Answer:

Adware

Explanation:

It's software that displays advertisements to users and gauges their preferences

8 0
3 years ago
Which contact field is used to control the name that would appear in the To field of an email message when a user is sending a m
ser-zykov [4K]

Answer:

Display as

Explanation:

Need the same question, but that's my guess, because display, means to show.

3 0
2 years ago
Read 2 more answers
While in slide show mode, if you are not careful you can close the application by clicking the x on the menu bar
sergejj [24]
When in slide show mode, the menu bar and that "x" are not visible.
5 0
3 years ago
Read 2 more answers
The engine that runs the computer. Small computers have one, while larger computers may
Dmitrij [34]

Answer:

CPU.

Explanation:

A processor, also known as a Central Processing Unit, is a piece of hardware in a computer that performs basic operations and control when executing program code.

Processors are usually made as integrated circuits closed in a hermetic casing, often with gold-plated leads (used for resistance to oxidation) and in this form they are called microprocessors - in common speech the terms processor and microprocessor are used interchangeably. The heart of the processor is a single crystal of silicon, on which a series of semiconductor layers have been applied by means of photolithography, forming, depending on the application, a network of several thousand to several billion transistors. Its circuits are made of metals with good electrical conductivity, such as aluminum and copper.

7 0
2 years ago
Select one technology limitation in regards to quality improvement (QI) programs Technology is not fast enough Not all electroni
pashok25 [27]

Answer:

The answer is "Not all electronic health records can generate quality reports" .

Explanation:

The main objective of QI is to improve results, that uses the CDC to identifies improvement as just an aspect of the three-pronged service delivery scheme. It uses information for decision-making to improve strategies, initiatives, and outcomes, and other option can be described as follows:

  • It the technology, which is fast enough.
  • In this technology vendors are interested.
  • In this, all the program does not require wireless networks.
3 0
3 years ago
Other questions:
  • What microsoft operating systems started the process of authenticating using password and username
    14·1 answer
  • What device brocasts all data packets to other nodes on a network?
    5·1 answer
  • The internet is an example of
    12·2 answers
  • A ____ is a collection of computers and users that are identified by a common security database. workgroup controller segment do
    7·1 answer
  • What allows a person to interact with web browser software?
    13·2 answers
  • What are the principal cybersecurity threats, both internal and external, and the principal safeguards that have been developed
    13·1 answer
  • Leonardo is having difficulty accessing the course website. he should contact the for assistance. (points:1)
    13·1 answer
  • Select the two statements below that are true. Press on the info button for
    13·1 answer
  • Write a C++ program that determines if an integer is a multiple of 7. The program should prompt the user to enter and integer, d
    13·1 answer
  • 50 POINTS!!!!!!!!!!!<br><br> Give at least two examples of how the transport layer is used.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!