100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Answers

Basic Programming Principles (2nd Edition) Chapter 3 Exercise Answers

Rating
-
Sold
7
Pages
12
Uploaded on
11-05-2018
Written in
2017/2018

Basic Programming Principles 2nd Edition by CM Pretorius and HG Erasmus. Insightful answers to the chapter questions. Really helpful for exams and assignments. Provides sequential steps to assist chapter answers.










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 11, 2018
Number of pages
12
Written in
2017/2018
Type
Answers
Person
Unknown

Subjects

  • ict1511

Content preview

Chapter 3 Answers

Exercises Page 48

Question 1

1.1

Planning:
Description Type Variable name
Input Name of item string name
Price of item real price
Output Name of item String name
Price of item real price

IPO chart:
Input Processing Output
name Prompt for input data name
price Enter input data price
Display output data

Algorithm:

ShowItemData
~ get the input
display “Provide the name” ~ on new line
enter name
display “Provide the price” ~ on new line
enter price
~ show output on screen
display “The name of the item is “, name ~ on new line
display “The price of the item is R”, price ~ on new line
end

Trace Table:

Test data: name = t-shirt and price = R29.70

Instruction name price output
display Provide the name
enter t-shirt
display Provide the price
enter 24.70
display The name of the item is t-shirt
display The price of the item is R29.70




Basic Programming Principles Second Edition Chapter 3 Answers
Page 1 of 12

, 1.2

Planning:
Description Type Variable name
Input First number integer number1
Second number integer number2
Output Sum of numbers integer sum
Difference between numbers integer difference
Product of numbers integer product

IPO chart:
Input Processing Output
number1 Prompt for 2 numbers sum
number2 Enter input numbers difference
Calculate output values product
Display output values

Algorithm:

ShowItemData
~ get the input
display “Provide the first number” ~ on new line
enter number1
display “Provide the second number” ~ on new line
enter number2
~ do calculations
sum = number1 + number2
difference = number1 – number2
product = number1 * number2
~ show output on screen
display “The sum is “, sum ~ on new line
display “The difference is ”, difference ~ on new line
display “The product is “, product ~ on new line
end

1.3

Planning:
Description Type Variable name
Input Number chairs per row Integer chairs
Number of rows integer rows
Output Total number of chairs integer totalChairs

IPO chart:
Input Processing Output
chairs Prompt for input data totalChairs
rows Enter input data
Calculate totalChairs
Display totalChairs


Basic Programming Principles Second Edition Chapter 3 Answers
Page 2 of 12
R80,00
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
kaylenpillay

Get to know the seller

Seller avatar
kaylenpillay University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
7
Member since
7 year
Number of followers
6
Documents
2
Last sold
6 months ago

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 exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Frequently asked questions