1.Write a program that will calculate and print out bills for the city water company.The water rates depend on whether the bill is for home use,commercialuse,or industrial use.A code of h means home use,a code of c means commercial use,and a code of

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/14 07:36:06
1.Write a program that will calculate and print out bills for the city water company.The water rates depend on whether the bill is for home use,commercialuse,or industrial use.A code of h means home use,a code of c means commercial use,and a code of

1.Write a program that will calculate and print out bills for the city water company.The water rates depend on whether the bill is for home use,commercialuse,or industrial use.A code of h means home use,a code of c means commercial use,and a code of
1.Write a program that will calculate and print out bills for the city water
company.The water rates depend on whether the bill is for home use,commercial
use,or industrial use.A code of h means home use,a code of c means
commercial use,and a code of i means industrial use.Any other code should
be treated as an error.The water rates are computed as follows:
Code h:$5.00 plus #0.0005 per gallon used.
Code c:$1000 for the first 4 million gallons used,and $.00025 for each
additional gallon.
Code i:$1000 if usage does not exceed 4 million gallons; $2000 if usage is
more than 4 million gallons,but does not exceed 10 million gallons; $3000
if usage exceeds 10 million gallons.
Your program should prompt the user to enter the code (type char),and the
gallons of water used (type float).Your program should then print the amount
due from the user.
---------------
Test Data:
Code:h
Usage:10000
Amount Due:$10
Code:c
Usage:5000000
Amount Due:$1250
Code:i
Usage:5000000
Amount Due:$2000
2 Write a program that takes in an alphabet character input from the user (you need
to do only lower case),and prints out the corresponding number on your telephone
handset.For example,if the input is a,then the number is 2.if the input is p,the
number is 7.If the input is not one of the characters in the alphabet,the number
that is printed is -1.Implement 2 versions of the program,one using switch statement
and one using if statements.
----------------
Test Data:
Enter the character:a
Corresponding number on the telephone :2

1.Write a program that will calculate and print out bills for the city water company.The water rates depend on whether the bill is for home use,commercialuse,or industrial use.A code of h means home use,a code of c means commercial use,and a code of
第一个:
#include
using namespace std;
int main(){
char code;
int usage;
double payment;
coutcode;
switch(code){
case 'h':coutusage;cout

英语翻译1.write a program that prints its input one word per line2.write a program that initia lizes an anrray of 10 elements.Each element should be equal to its subsript.The program should then print each of the elements.3.write a program that w Write a program to append one file”1.txt” at the end of another “2.txt”.用c编 写一个c 程序 Write a C programWrite a C program that receives from the command line a student ID (SXXXXX) to be used as a reference.Then the program asks the user to introduce the information about the results obtained by a set of students in th 1. Write a program to copy its input to its output, replacing each string of one or more blanks by single blank. 2. Write a program to copy its input to its output, replacing each tab by . This makes tabs visible in an unambiguous way.3. Write a p write a program that converts a number in base 10 to its equivalent in base 2. Java write a program to calculate the factorial of any natural number entered by a user. Write the letters in order to make a new word.(BOAYEVQIGHLCDATFJKMNPRS) 题在下面:1.the 1st,3rd,and the 9th letter:( )2.the 13th,3rd and the 4th letter:( )3.the 6th,5th,22nd and 4th letter:( )Tongue TwisterElizabeth's birthday is on the third Th A leap year is a year with 366 days.A leap year has the 29th February.A year is a leap year if it is divisible by 4 except forthe century years (divisible by 100).Century years are only leap years if they are divisible by 400.Write a program thatacce Write a C program that accepts ten number and decide whether the number is prime. Write a program to print the first 10 Fibonacci numbers.Each Fibonacci numb Write a program that generates 4-,10-,or 20-sided dice. write a program to represent multiplication tables.用最简单的JAVA语言. Please write a Java program,compute the GreatestCommonDivisor求JAVA程序 Write a program to find all Armstrong number in the range of 100 and 999. matlab编程问题,希望大家能帮我解决,1.Write a simple MATLAB program,using an appropriate loop structure,that prints out the string “Hello World!” to the screen exactly 10 times.2.Write a MATLAB program which continues to ask the user f This computer program ______(write) in 2004 write a program to read a four digit integer and print the sum of its digits.Hint :Use / and % operators. Write a program,which performs as the following:(java)Write a program,which performs as the following:Create two interfaces Automobile and Nonautomobile.They contain abstract methods AutomobileMotionMode( ) and NonautomobileMotionMode( ).Create a