Gavimetris

Solo disponible en BuenasTareas
  • Páginas : 2 (290 palabras )
  • Descarga(s) : 0
  • Publicado : 6 de noviembre de 2011
Leer documento completo
Vista previa del texto
Problemas
1. Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program shoulddisplay the following:
a. The number of characters in the city name
b. The name of the city in all uppercase letters
c. The name of the city in all lowercaseletters
d. The first character in the name of the city

2. Write a program that computes the tax and trip on a restaurant bill. The program should ask theuser to enter the charge for the meal. The tax should be 6.75 percent of the meal charge. The tip should be 15 percent of the total after adding the tax. Displaythe meal charge, tax amount, tip amount, and total bill on the screen.

3. A soft drink company recently surveyed 12,467 of its customers and found thatapproximately 14 percent of those surveyed purchase one of more energy drink per week. Of those customers who purchase energy drinks, approximately 64 percent of themprefer citrus flavored energy drinks. Write a program that displays the following:
a. The approximate number of customers in the survey who purchase one ormore energy drinks per week.
b. The approximate number of customers in the survey who prefer citrus-flavored energy drinks.

4. Write a program that reads aninteger between 0 and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all its digits is 14.

5. Write a program thatreceives an ASCII code (an integer between 0 and 128) and displays its character. For example, if the user enters 97, the program displays character a.
tracking img