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
Exam (elaborations)

oop practice questions

Rating
-
Sold
-
Pages
1
Grade
B
Uploaded on
01-07-2025
Written in
2024/2025

A focused set of beginner-to-intermediate level questions covering key C++ topics like functions, loops, arrays, OOP, and file handling. Perfect for exam prep, assignments, and viva practice.

Institution
Course

Content preview

NUST College of Electrical & Mechanical Engineering,
RAWALPINDI
Lab-Mid Exam
CS-107: Computer Programming
Total Marks: 30
Course Instructor: Dr. Farhan Hussain Time Allowed: 60 Minutes
Lab Instructor: Engr. Eman Fatima Degree & Syndicate: EE-46-B

Problem statement:
An online store wants to automate its billing system to streamline the checkout process for
customers and ensure accurate pricing. Suppose a customer walks into the store or visits the
online platform, adding multiple products to their cart. At the checkout, the system should
efficiently calculate the total cost of all purchased items, apply relevant discounts, and generate
the final bill. The store follows a discount policy where:
 Purchases above 10,000 PKR receive a discount based on the last two digits of your
CMS ID.
 Purchases between 5,000 PKR and 10,000 PKR receive a discount based on the first two
digits of your CMS ID.
 Purchases below 5,000 PKR receive no discount.
To implement this, the system should first allow the customer to enter the number of items they
are purchasing. Then, using an array, it should store the price of each item and compute the
total bill. The system must ensure data validity, if a customer mistakenly enters a negative
price, the system should detect this and allow them to re-enter a valid amount. A user-defined
function should be used to apply the appropriate discount based on the total purchase amount.
After processing the purchase, the program should display the original total amount, discount
applied, and final bill in a user-friendly manner. To make the system more interactive,
customers should be given the option to make another purchase after completing one transaction,
allowing the program to run continuously until the customer chooses to exit.



General Instructions
 Understanding the question is part of the exam, attempt as per your best comprehension.
 This is a strictly Closed Book exam, accessing Lab Manuals, Lab reports, Lecture Slides,
personal notes or any other resource from LMS or elsewhere is not allowed.
 Use of Gen. AI platforms, including but not limited to ChatGPT, is not allowed.


Page 1 of 1

Written for

Course

Document information

Uploaded on
July 1, 2025
Number of pages
1
Written in
2024/2025
Type
Exam (elaborations)
Contains
Only questions

Subjects

$8.49
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
hadiqagulzar

Get to know the seller

Seller avatar
hadiqagulzar NUST College of Electrical & Mechacical Engineering
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
10 months
Number of followers
0
Documents
9
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