0% found this document useful (0 votes)
5 views2 pages

COP2210 Assignment 2 Overview

This document outlines the details for Assignment 2 of COP 2210: Computer Programming I, due on May 29, 2022. It includes instructions for submission, a grading rubric, and two programming tasks: one for calculating discounts based on bill amounts and another for evaluating simple arithmetic equations. Students must ensure their code is well-organized, error-free, and meets the specified requirements.

Uploaded by

Daniel Estrada
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

COP2210 Assignment 2 Overview

This document outlines the details for Assignment 2 of COP 2210: Computer Programming I, due on May 29, 2022. It includes instructions for submission, a grading rubric, and two programming tasks: one for calculating discounts based on bill amounts and another for evaluating simple arithmetic equations. Students must ensure their code is well-organized, error-free, and meets the specified requirements.

Uploaded by

Daniel Estrada
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COP 2210: Computer Programming I

Assignment – 2: Conditional Structure


Due Date & Time: Sunday May 29, 2022, 11:59 pm
Instructor: Ahmad Waqas, PhD

Instructions:
➢ Submission time will not be extended in any case.
➢ Zip the complete project of each Task and submit the .zip file.
➢ The general rubrics are given below:
Description Max. Marks
Coding style
The code is well organized and very easy to follow. 10%
The variable names are following the naming standards. 10%
Logic
Student has used the appropriate variables and correct datatypes. 15%
Student has used appropriate conditional statements and structures. 15%
Student has used the effective programming logic for solution. 15%
Student has demonstrated the appropriate concept in respective task. 15%
Results
The program is error-free and generates the expected results as per the specifications. 20%

Task – 1: [50 pts.]


A shopkeeper announces the following promotional package for customers

• 7% discount for all bills of amount less than or $350


• 10% discount for all bills of amount between $351 and $500
• 12% discount for all bills of amount between $501 and $750
• 15% discount for all the bills of amount more than $750.
Write a java program that takes amount of the bill from user and calculates the payable amount by
applying the above discount criteria and display it on the screen. Your program must evaluate that the
input is valid (for example, a bill cannot be negative value).
A sample output of the program is given below:

COP2210 – Assignment 2 Page 1 of 2


Task – 2: [50 pts.]
Write a program that will calculate a simple equation. The program will ask user to enter an arithmetic
equation having one operator and two operands (for example, 5 + 3, where 5 and 3 are operands and
+ is an operator). It is assumed that user will enter the operands and operator in correct order and
separated by space. Users are allowed to use only arithmetic operations i.e., +, -, *, / and %.
Your program will read the input in proper variables and do the desired arithmetic operation (for
instance, you may store the operands in int and operator in char variables). The program will output
the result or an error message if the correct operator is not given as input.
(Hint: It is recommended to use the switch statement to check which operation to perform.)
A sample output of the program is given below:

COP2210 – Assignment 2 Page 2 of 2

You might also like