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]
4 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]4 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
Does anybody know how to fix my Minecraft??? My character isn’t loading and realms aren’t working?? Look at the picture!
Rasek [7]

Answer:

This happened to me last week, what helped me: uninstalling and reinstalling,

you could also try logging out and logging in

Explanation:

5 0
3 years ago
1) Type a statement that gets an input value into variable numBers. Assume scnr already exists and numBers has been declared.
Sergio039 [100]

Answer:

Following are the code in the java language  

numBers = scnr.nextInt ( ) ;

Here scnr is an instance of scanner class .

Explanation:

In this code, we take the input by using the object of Scanner class i.e "scnr". The scanner class in the java programming language is used for taking the input by the user. The scnr.nextInt ( )  is taking the input which is stored in the  "numbers" variable.

So the whole program is looking like that  

import java.util.*; // import package  

public class Main

{

public static void main(String[] args) // main function

{

 int numBers; // variable declaration

 Scanner scnr=new Scanner(System.in); // create the instance of scanner class

 numBers=scnr.nextInt( ) ; // taking input

 System.out.println(numBers); // display the value of numBers

}

}

Output:

78

78

4 0
3 years ago
Seeking additional information is known as _____.
Sauron [17]

Answer:

B. proofing

Explanation:

You want to seek additional information because you want to prove your point or any point that suppers your answer.

Hope that helped:))

5 0
3 years ago
Read 2 more answers
A disadvantage of online surveys is that _________. a. it is difficult to access large numbers of potential respondents. b. they
Minchanka [31]

Answer:

B seems like the best answer to me.

Explanation:

7 0
3 years ago
You work for ScreensRUs, a business that sends repair people to sites to fix damaged car windshields. Your employer provides com
Ede4ka [16]

Answer:

tldr; treat this like a brief essay. some reasons would be "having a smartphone makes your job easier", "smartphones can make the job easier to do on the go".

Explanation:

hi there!

ok, so this should be pretty simple.  first, we should take a look at the issue in the scenario;  you're an employee for a company that relies heavily on technology to get your job done and send other employees to their customer's locations.  because of this, getting poor quality mobile phones would make your job a little bit harder to do.

to put this in a little bit of a better perspective, imagine that you're an employee in a store, and your job is to sweep the floor. however, your boss only gives you a dust pan and bad quality broom.  that'd make you wish that you had some better equipment to get your job done faster, right?

a memo is basically a written message in a business place; in modern days, they're usually emails, but back in the day they were letters and such.  for this assignment, treat this like an essay! however, be sure to be to-the-point.

now to answer the question; we've already covered one reason that you could use in the memo: "having a smartphone would make your job easier". now think about what else having a smartphone would do compared to a mobile company phone.  

here's an example of a memo!

good luck! hope this helped.

5 0
3 years ago
Other questions:
  • Which steps will complete adding the cells A45 to A55?
    8·1 answer
  • What is a search engine and how is it different from a browser?
    6·1 answer
  • One of the best examples of outcome control is the re-hiring of Steve Jobs by Apple as CEO
    14·1 answer
  • .doc What is the difference between a skilled hacker and an unskilled hacker, other than skill levels? How does the protection a
    5·1 answer
  • Which is NOT a joint?<br> A. <br> Femur<br> B. <br> Knee<br> C. <br> Elbow
    13·2 answers
  • Private sharing model on Opportunities. Leadership has asked the Administrator to create a new custom object that will track cus
    7·1 answer
  • You can select multiple words by using the ______ keys repeatedly.
    6·1 answer
  • Three common risk factors for young drivers and how you plan to minimize these factors.
    13·1 answer
  • Consider the following first line from a Java method definition.
    13·1 answer
  • Who knows my cousin better?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!