Homework 1 Algorithm

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Connor Griggs

CSCE 1030 sec.002


09/09/15
Homework 1 Algorithm
1) First, declare variables for the users name, the positive integer to input, and the
four place values that will output.
-Ex. Variable names- name, integer, thousands, hundreds, tens, ones
2) Second, output the programmers information using a block format.
3) Prompt the user to enter their name and output a greeting with their name.
4) Prompt the user to input a positive, 4-digit integer, and store it in a variable.
5) Calculate the place values of the integer using division and modulus operators,
and store the calculations in the place value variables. Use the modulus operator
to take the previous calculations remainder, and assign the integer variable with
the new integer update.
-

Integer/1000, integer%1000
Integer/100, integer%100
Integer/10, integer%10
integer/1

6) Lastly, display the calculated place values by placing each place value variable
in a statement.
7) Compile and run.

You might also like