Docsity

Java Programming Assignment: Discount Calculation and Loop Statements - Prof. Maduka, Exercises of Java Programming

Partial preview of the text

Download Java Programming Assignment: Discount Calculation and Loop Statements - Prof. Maduka and more Exercises Java Programming in PDF only on Docsity!

FACULTY OF MANAGEMENT, COMMERCE AND LAW

BUSINESS INFORMATION SYSTEMS DEPARTMENT

OBJECT-ORIENTED PROGRAMMING

(BIS 2142 )

Activity 3

TOTAL MARKS: 100

DUE DATE: 24 April 202 4 (Time: 10h00AM )

INSTRUCTIONS:

▪ All Java files must be saved in one folder. ▪ A zipped folder with all the Java files must be submitted using the Moodle platform under the Assignment/ Activity banner. ACTIVITY/ ASSIGNMENT QUESTIONS:

  1. Write a Java program that calculates discounts based on the number of items a student as a customer will buy. The program should prompt a customer to login by entering a student number as a username and the first six digits of your ID number as a password. In addition, a salesperson will use “ 1111 ” as a username and password. Furthermore, the program should prompt the normal user or salesperson to enter the number of items and then generate and display a receipt. The amount for each item is R 10 .45 and discount percentages are structured as follows: No Items quantity Customer Salesperson 1 0 to 14 items No discount 2 % discount 2 15 to 20 items 5% discount 7% discount 3 21 to 30 items 8% discount 10% discount 4 31 to 40 items 12% discount 15% discount 5 41 or more items 20% discount 25 % discount The output should look like this: