Introduction to Computer Science - Desklib

   

Added on  2023-06-09

10 Pages1002 Words348 Views
Running head: INTRODUCTION TO COMPUTER SCIENCE
Introduction to Computer Science
Name of the student:
Name of the University:
Author note:
Introduction to Computer Science - Desklib_1
1
INTRODUCTION TO COMPUTER SCIENCE
Question 1
Problem Description
The user is to enter the retail price of a sold item, the employee number of the employee who is
dealing with the sale and the transaction code. The program shall check if the transaction code is
valid or not. Furthermore, the program will calculate the commission price of the item based on
the provided chart: A: 6%, B: 8%, C: 10%
Pseudo Code
Start
1. Enter Retail Price
2. While transaction code invalid
a. Enter Transaction Code
b. If Transaction Code not in range ‘A’, ‘B’ or ‘C’
i. Display Error Message
c. Else break out of while loop
3. Enter Employee Number
4. Display Retail Price
5. Display Employee Number
6. If Transaction Code = ‘a’ or ‘A’
a. Commission = 6/100*Retail Price
7. Else if Transaction Code = ‘b’ or ‘B’
a. Commission = 8/100*Retail Price
8. Else
Introduction to Computer Science - Desklib_2
2
INTRODUCTION TO COMPUTER SCIENCE
a. Commission = 10/100*Retail Price
9. Display Commission
Stop
Desk Check testing
Input: Employee ID- 159357, Transaction ID- C, retail price- 100
Expected Output: 10
Sl. no. Retail Price Transaction ID Employee
No.
Commission Display
Output
1 100
2.a. C
3 159357
4 100
5 159357
...
8.a 10/100*100=10
9 10
Input: Employee ID- 159357; Transaction ID- A; Retail price- 50;
Expected Output: 3
Sl. no. Retail Price Transaction ID Employee Commission Display
Introduction to Computer Science - Desklib_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Introduction to Computer Science - Algorithms for Problem Solving
|11
|974
|222

Programming
|5
|531
|69