Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Coding

Rating
-
Sold
-
Pages
32
Uploaded on
08-09-2023
Written in
2023/2024

CMPS151 is a course code commonly used to represent an introductory computer science course at many universities. It typically covers fundamental concepts in computer science such as programming, algorithms, data structures, and problem-solving.

Show more Read less
Institution
Course

Content preview

CHAPTER 2
Input, Processing, and Output

, Designing a Program
Programs must be designed before they are written

Program development cycle:
1. Design the program
2. Write the code
3. Correct syntax errors
4. Test the program
5. Correct logic errors

, Input, Processing, and Output
• Typically, computer performs three-step process
• Receive input
• Input: any data that the program receives while it is running
• Perform some process on the input
• Example: mathematical calculation
• Produce output

Calculate the
average
Input: Output:
3 numbers The average

, Displaying Output with the print Function
print function: displays output on the screen

Example the statement
print(‘Hello world’)
Will display the message: Hello world

String: sequence of characters that is used as data

String literal: string that appears in actual code of a
program
Must be enclosed in single (') or double (") quote marks

So the above statement also can be written
print(“Hello world”)
Using double (“) quote

Written for

Institution
Course

Document information

Uploaded on
September 8, 2023
Number of pages
32
Written in
2023/2024
Type
Class notes
Professor(s)
Zeeyad ali
Contains
Class 1

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
rl-prodz

Get to know the seller

Seller avatar
rl-prodz Qatar University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions