d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Need Some Computer Science Help
Add Reply New Topic New Poll
Member
Posts: 16,241
Joined: Oct 31 2005
Gold: 6,000.69
Sep 24 2013 08:23pm
will get fgs in a hurry need some quick help with these

the programming is done on c++ on visual studios 2012


32. Write a statement to print the following line. Assume the total value is contained in a variable named cost.

The sales total is: $ 172.53
^^^^^^^^^^^^^^^^^^^^

33. Write a program that uses four print statements to print the pattern of asterisks shown below.

******
******
******
******
34. Write a program that uses four print statements to print the pattern of asterisks shown below.

*
**
***
****

35. Write a program that uses defined constants for the vowels in the alphabet and memory constants for the even decimel digits (0,2,4,6,8). It then prints the following three lines using literal constants for the odd digits.

a e i o u
0 2 4 6 8
1 3 5 7 9

36. Write a program that defines five intiger variables and initializes them to 1, 10, 100, 1000, and 10000. It then prints them on a single line seperated by space characters using the decimal conversion code (%d), and on the next line with the float conversion code (%f). Note the differences between the results, how do you explain them?

37. Write a program that prompts the user to enter a quantity and cost. The values are to be read into an intiger named quantity and a float named unitPrice. Define the variables, and use only one statement to read the values. After reading the values, skip one line and print each value, with an appropriate name on a seperate line.

38. Write a program that prompts the user to to enter an intiger and then prints the intiger firsr as a character, then as a decimal, and finally as a float. Use seperate print statements. A simple run is shown below.

The number as a character: K
The number as a decimal :75
The number as a float : 0.000000

This post was edited by G_Eagle on Sep 24 2013 08:24pm
Go Back To Homework Help Topic List
Add Reply New Topic New Poll