0% found this document useful (0 votes)
14 views

Class Assignment 1

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Class Assignment 1

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming Fundamentals

Class Assignment # 1

Total Marks: 20 Instructor Name: Amna Mahmood Deadline: 05-11-24 till 11:59 PM

Instructions:
1) You have to submit two files i.e.
• CPP file of the program
• CPP should be combined with files into zip folder.
2) Make group of 2 members and only one member have to upload assignments on
CMS.
3) All program codes should be written in C++. Students should use Visual studio/Dev
C++ compiler for coding.
4) Plagiarism in the work is Professional dishonesty which leads to strict disciplinary
action and zero in grading of Assignment.

CLO Taxonomy
CLO STATEMENT PLO
NO LEVEL

1
Be able to identify the logical and/or syntax errors in a 1 C1
program
Question 1: [10-Points]

Write a program that reads Name of Company, Product Name, and Per Quarter sale of each
product from file “sale.txt”.

For each product, calculate annual sale and average sale of each quarter using below details. Store
the Company Name, Product Name and annual sale as well as average sale of every Product in the
file “Output.txt”.

sale.txt
Dawlance, LED, 355, 210, 312, 226
Dawlance, Refrigerator, 102, 96, 106, 124
Haier, LED, 212, 310, 336, 426
Haier, Refrigerator, 199, 210, 264, 298
Output.txt
Dawlance, LED, 1103, 275
Dawlance, Refrigerator, 428,107
Haier, LED, 1284, 321
Haier, Refrigerator, 673, 168
Question 2: [10-Points]
Read the data character from read.txt and display the output except character ‘a’.

Example:

read.txt

C++ is a high-level, general-purpose


programming language created by Danish
computer scientist Bjarne Stroustrup.

You might also like