Programming
Guided Practice: Creating a Flowchart and C Program
Objectives: Learn different data types and their matching conversion specifiers
Program Description: Display a character and a float value.
Create the flowchart below using Flowgorthm:
New Syntax Items: In Flowgorithm, we use the string data type to store character values and the real data type to store float values (numbers with decimal places). Also, notice that we use the & sign in output statements when concatenating text to values stored in variables that we wish to display.
Create the matching C program using Dev C++
New Syntax Items: Add comments throughout your program using the // syntax to explain what is happening with certain commands. The %.2f in the last output statement tells the compiler to display the value with 2 decimal spaces – this is known as precision. Also, we place a space in front of %c in the scanf() statement so that it does not read any white space characters when storing user input.
Here is what the output will look like:
Run your program. Take a screenshot of the output screen.
Upload your Flowgorithm .fprg, .c source file, and a screenshot of the C output screen into the course dropbox for grading.