We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Assignment No. 3 Semester: Spring 2020

CS201 – Introduction to Programming

Total Marks: 20

 

Due Date: 23/07/2020

Instructions

Please read the following instructions carefully before submitting assignment:

It should be clear that your assignment will not get any credit if:

 

o        Assignment is submitted after due date.

o        Submitted assignment does not open or file is corrupt.

o        Assignment is copied (From internet/students).

 

Software allowed to develop Assignment

-          Dev C++

 

Objectives:

To enable students to understand and practice the concepts of:

  • Classes
  • Objects
  • Loops
  • File handling

 

 

Assignment Submission Instructions

You have to submit only .cpp file on the assignments interface of CS201 at VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.

Please note again, assignment submitted other than .cpp format will get zero marks.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Assignment

 

 

 

Assignment Statement:

Assume you are working as a sports data analyst for a university named “ABC University”. Your job is to collect data of different players and judge their performance.   Based on the data collected from players, their performance for a given season will be analyzed and comparison among players of the team will be made for selection. For this purpose, you are required to write a program in C++ that will create a class named “Sports”. The class will create a file named “Sample.txt” in the current directory. You will use file handling mechanism for entering player’s information. Following tasks are required:

 

  • You are required to create a class named “Sports”.
  • Declare three data members of Sports class named playername, game_name and total_wins with appropriate data types.
  • The class will consist of 6 functions named input_file(), read_file(), notstartingwithA(), lower(), upper() and digit() respectively along with a default constructor. The description of each function is given with the screenshots in the “Sample output”.
  • In the main() function an object of the class “Sports” will be created and it will be used along with switch statement to call the functions mentioned above. i.e. input_file(), read_file(), notstartingwithA(), lower(), upper() and digit().
  • Initially a menu will be displayed consisting of different choices as shown below:

 

 

  • User will enter a choice from the choices given in the menu. Output of each selected number is shown in the output samples below for detailed description.

 

Sample Output:-

1.

  • In the first step the following menu will appear at the output screen.

 

 

  • User will first populate file “Sample.txt” before reading the file as given below.

 

 

 

 

 

 

2.

  • The function named input_file() will take input from user and store it in the file named “Sample.txt”. If a user wants to enter second record, the first record in the file will not be deleted; rather new data will be added at the end of the file.

 

 

 

 

 

3.

 

  • The function read_file() will read all data stored in the file “Sample.txt” from start to end.

 

 

 

 

 

 

 

 

4.

  • The function notstartingwithA() will check the file and find all lines of the file “Sample.txt” that are not started with character “A” including blank lines. E.g. the above data will consists of 3 lines in the file. notstartingwithA() function will count all those line and display the count on output screen as given below.

 

 

 

5.

  • The function lower() will find all those lines that are started with lower characters in the file “Sample.txt” and display the count on outputs screen as given below.

 

 

 

 

 

6.

  • The function upper() will find all those lines that are started with an upper case character in the file “Sample.txt” and display the count on outputs screen as given below.

 

 

 

 

 

7.

  • The function digit() will find all those lines that are started with a digits in the file “Sample.txt” and display the count on output screen.

 

 

 

 

 

 

 

 

8.

  • Program will also check for invalid choices as given below.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best of luck

 

 

Lectures Covered: (Lecture # 17- 27) and Solution Deadline: (23/07/2020).

 


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 747

Replies to This Discussion

CS201 Assignment No. 3 Spring 2020 Solution by VU ACADEMY

Objectives: To enable students to understand and practice the concepts of: • Classes • Objects • Loops • File handling Assignment Statement: Assume you are working as a sports data analyst for a university named “ABC University”. Your job is to collect data of different players and judge their performance. Based on the data collected from players, their performance for a given season will be analyzed and comparison among players of the team will be made for selection. For this purpose, you are required to write a program in C++ that will create a class named “Sports”. The class will create a file named “Sample.txt” in the current directory. You will use file handling mechanism for entering player’s information. Following tasks are required: • You are required to create a class named “Sports”. • Declare three data members of Sports class named playername, game_name and total_wins with appropriate data types. • The class will consist of 6 functions named input_file(), read_file(), notstartingwithA(), lower(), upper() and digit() respectively along with a default constructor. The description of each function is given with the screenshots in the “Sample output”. • In the main() function an object of the class “Sports” will be created and it will be used along with switch statement to call the functions mentioned above. i.e. input_file(), read_file(), notstartingwithA(), lower(), upper() and digit(). • Initially a menu will be displayed consisting of different choices as shown below: #CS201 #CS201Assignment3 #CS201AssignmentSolution #CS201SolvedAssignment #CS201Assignment3Solution2020 #CS201Assignment3Spring2020 #CS201AssignmentSolution #CS201Programming #CS201AssignmentNo3 #CS201Assignment3Solution2020 #CS201Solution #CS201Assignment3Solution2020 #CS201SolutionLink #CS201Assignment3Solution2020 #CS201DownloadLink #CS201AssignmentPDF #CS201AssignmentCPP #C #CS201Assignment3Solution2020 #CS201AssignmentSolutionCPP #CS201CPPFile #CS201Assignment #CS201Assignment3Solution2020 #CS201AssignmentDownload #CS201Solve #CS201Assignment3Solution2020 #CS201Assignment3 #CS201Assignment3Solution2020 CS201 Assignment 3 Solution 2020 CS201 Assignment 3 Solution 2020 CS201 Assignment 3 Solution 2020 CS201 Assignment 3 Solution 2020 CS201 Assignment 3 Solution 2020 CS201 Assignment 3 Solution 2020 CS201 Assignment 3 Solution 2020 CS201 Assignment 3 Solution 2020

I cant download this file, please post it again

#CS201

copy in DevC++ and run this code

Attachments:

RSS

Latest Activity

+ !! SARAH replied to Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
30 minutes ago
+ ᴄᴏғғᴇᴇ updated their profile
35 minutes ago
Rizwan Mushtaq joined +M.Tariq Malik's group
51 minutes ago
Arooj Shahid liked 乇メ-丂イひり3刀イ.'s discussion *** My Drawing ***
1 hour ago
Arooj Shahid liked 乇メ-丂イひり3刀イ.'s discussion *** الوداع اردو ***
1 hour ago
Arooj Shahid liked Miss. Churhail's discussion LOVE YOUR LIFE!!!!!
1 hour ago
Arooj Shahid liked Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
1 hour ago
Arooj Shahid liked Omar's discussion Dua
1 hour ago
+!!! ❤️ Shadow Girl❤️!!! liked 乇メ-丂イひり3刀イ.'s discussion *** الوداع اردو ***
1 hour ago
+!!! ❤️ Shadow Girl❤️!!! liked Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT201 Financial Management GDB No 01 Fall 2020 Solution / Discussion in the group MGT201 Financial Management
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT201 Financial Management GDB No 01 Fall 2020 Solution / Discussion in the group MGT201 Financial Management
2 hours ago
Profile IconSaba Shahzadi, waqar, Hammad Syed and 12 more joined Virtual University of Pakistan
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion ENG001 Elementary English GDB No 01 Fall 2020 Solution / Discussion Last Date: 04-12-2020 in the group ENG001 Elementary English
2 hours ago
Miss. Churhail liked Omar's discussion Dua
2 hours ago
+ "Տehɑr" liked Omar's discussion Dua
3 hours ago
+_iiffiiiiiii_+ updated their profile
3 hours ago
+_iiffiiiiiii_+ liked +_iiffiiiiiii_+'s profile
3 hours ago
HAFIZA AREESHA ASLAM replied to +M.Tariq Malik's discussion SOC101 Introduction to Sociology Assignment 01 Fall 2020 Solution / Discussion in the group SOC101 Introduction to Sociology
3 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT402 Solved MCQs Online Quiz No 01 Fall 2020 Solution / Discussion Last Date: 08-12-2020 in the group MGT402 Cost & Management Accounting
4 hours ago

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.