Input and Output - PowerPoint PPT Presentation

About This Presentation
Title:

Input and Output

Description:

used to get the information from the user into a variable. YOU MUST ... Ask the user their name and include a title on the report. Like Luci's Calorie Counter. ... – PowerPoint PPT presentation

Number of Views:82
Avg rating:3.0/5.0
Slides: 8
Provided by: luciw
Category:

less

Transcript and Presenter's Notes

Title: Input and Output


1
Input and Output
2
Output
  • Prompt
  • A message displayed to the user indicating what
    they are to enter.
  • Should be clear and exact on what you want.
  • write
  • used for output, no return
  • writeln
  • has a return for next line to be printed on CRT.

3
Input
  • readln
  • used to get the information from the user into a
    variable.
  • YOU MUST PUT THE VARIABLE NAME!!!
  • readln(name)
  • Can be used without a variable to hold the output
    on the screen.
  • readln

4
Formatting Output
  • In a writeln you can combine literals and
    variables by seperating them by commas.
  • writeln(Hi , name, , it is nice to meet you!)

5
More on Formatting
  • You can increase the number of spaces that a
    variable uses.
  • writeln(Name10, Date10)
  • Name Date
  • For real numbers you can also state the number of
    places after the decimal.
  • writeln(Ave, ave51)
  • Ave 95.6

6
Assignment Statement
  • is read becomes equal to.
  • variable expression.
  • ave (num1num2)/2
  • operators follow math order of operations
  • ( plus), (- minus), ( multiply),
  • (/ division), (divquotient of integer
    division),
  • (modremainder of integer division)

7
Assignment
  • Questions for chapter 4 are due Friday.
  • Lab test on Friday 1/2 period 6 on page 110.
  • Written Test on Friday ch 3 and 4
  • Program due next Friday
  • Do the 5 steps for the following assignment.
  • Number 4 on page 111. Be sure to be colorful and
    creative with your output.
  • Ask the user their name and include a title on
    the report. Like Lucis Calorie Counter.
Write a Comment
User Comments (0)
About PowerShow.com