Showing posts with label Introduction to Programming. Show all posts
Showing posts with label Introduction to Programming. Show all posts

CS201: Assignment No 04 Solution

By: // No comments:

Cs201 Introduction to Programming

cs 201 Assignment no 4:

Please read the following instructions carefully before submitting assignment.
It should be clear that your assignment will not get any credit if:

The assignment is submitted after due date.
The submitted assignment does not open or file is corrupt.
Assignment is copied(partial or full) from any source (websites, forums, students, etc)

Objective:

The objective of this assignment is to provide an on hand experience of:
Learn to use object oriented concept
Learn to map real world problem in the context of computer programming
Guidelines:

Create a class for “StaffRegistration”.
Provide getter and setter functions for each data member.
Use two member functions “InputStaffData()” and “DisplayStaffData()” for getting input and displaying it respectively.
Code should properly be indented and well commented.
Follow C/C++ rules for code documentation.
Use only Dev-C++ for this assignment. If you are using any other tool then mention it at top of your code file as comments.

Assignment Description

Etradehouse is an online shopping store, which deals with selling of goods across Europe. They have regional offices in different countries (Pakistan, China & UK). The support, purchase and sales staff works in regional office (Pakistan).
They hire new employees in order to run their business smoothly, but currently they have no automated system for hiring of their employees. As a C++ programmer, your task is to write a computer program in C++ which could register the newly hired staff and then display summary of it.

The data about the staff, that the company is interested are as follows:-
CNIC ( National Identity Card Number in the form XXXXX-XXXXXXX-X)
Name ( Name of employee)
Father Name
Date of Birth
Qualification
Designation
Salary
Joining Date
Contact Number
Address
Your Task
Your task is to create the program which produces the output as shown in “screenshot”.
Screenshot of the desired  output:
Here display your name & VU ID.

Note
Object oriented approach MUST be used in order to implement the assignment.
Submission
You are required to  your assignment through LMS in zip format containing two files.
Your solution C++ program i.e .cpp file
An MS Word document containing screenshot of your program output/execution

Cs 201 Assignment No 4 Solution:

#include
using namespace std;
class StaffRegistration
{
private:
char cnic[16];
char name[20];
char fname[20];
char dob[11];
char degree[10];
char desig[15];
int sal;
char joinDate[11];
char cell[13];
char address[40];
public:
void InputStaffData()
{
cout"\nPlease enter National Identity Card Number(CNIC)"endl;
cin>>cnic;
cout"Please enter name"endl;
cin >> name;
cout"Please enter father name"endl;
cin >> fname;
cout"Please enter date of birth (dd/mm/yyyy)"endl;
cin>>dob;
cout"Please enter qualification"endl;
cin>>degree;
cout"Please enter salary"endl;
cin>>sal;
cout"Please enter joining date (dd/mm/yyyy)"endl;
cin>>joinDate;
cout"Please enter contact number"endl;
cin>>cell;
cout"Please enter address information"endl;
cin>>address;
cout"Record added successfully !!!"endlendl;
}
void DisplayStaffData()
{
cout"CNIC: \t\t\t"cnicendl;
cout"Name: \t\t\t"nameendl;
cout"Father Name: \t\t"fnameendl;
cout"DoB: \t\t\t"dob endl;
cout"Qualification: \t\t"degreeendl;
cout"Salary: \t\t"salendl;
cout"Joining Date: \t\t"joinDateendl;
cout"Contact Number: \t"cellendl;
cout"Address: \t\t"addressendl;
}
};
main()
{
system("cls");
StaffRegistration emp;
emp.InputStaffData();
cout"---------------------------------------------------------------------------"endl;
cout"\t\t\t\ DISPALAY STAFF INFORMATION"endl;
cout"---------------------------------------------------------------------------"endl;
emp.DisplayStaffData();
cout"---------------------------------------------------------------------------"endl;
system("pause");
}

CS201- midterm solved mcqs - Introduction to Programming

By: // No comments:

CS201 Introduction to Programming midterm  MCQ's 

CS201 Introduction to Programming.Download/upload Video Lectures, Handouts, Helping Materials, Assignments Solution, Online Quizzes, GDB, Past Papers, Solved Papers and more


CS201- Introduction to Programming 

Latest Solved Mcqs from Midterm Papers

May 07,2011 
Lectures 1-22

MIDTERM EXAMINATION 
Spring 2010 
Question No: 1 ( Marks: 1 ) - Please choose one 
In order to get 256 from the number 2568 we divide this number by 10 and take, 
► Its remainder 
► The number 
► Its quotient 
► Its divisor 

virtual study solutions

Question No: 2 ( Marks: 1 ) - Please choose one 
The correct syntax of do-while loop is, 
► (condition ) while; do { statements; }; 
► { statements; } do-while (); 
► while(condition); do { statements; }; 
► do { statements; } while (condition); 

CS201 Midterm solved mcqs

Question No: 3 ( Marks: 1 ) - Please choose one 
Which of the following function(s) is/are included in stdlib.hheader file? 
► double atof(const char *nptr) 
► int atoi(const char *nptr) 
► char *strcpy ( char *s1, const char *s2) 
► 1 and 2 only  (Pg 191)

CS201 Short Notes

Question No: 4 ( Marks: 1 ) - Please choose one 
If the break statement is missed in switch statement then, 
► The compiler will give error 
► This may cause a logical error  (Pg 76)
► No effect on program 
► Program stops its execution 

CS201 Solved Papers

Question No: 5 ( Marks: 1 ) - Please choose one 
The data type before a function name represents its, 
► Return Type ( Pg 499)
► Function data 
► Function arguments 
► Function name 

Question No: 6 ( Marks: 1 ) - Please choose one 
Member function tellg() returns the current location of the _____________ pointer. 
► tellptr() 
► write() 
► seekg() 
► get() (Pg 215)

Question No: 7 ( Marks: 1 ) - Please choose one 
What does 5 | 6 , evaluate to in decimal where ‘|’ is bitwise OR operator?
 ►3 
 ►4 
 ►5 
 ►7 
5 | 6 = 
0 1 0 1 
0 1 1 0 
-------- 
0 1 1 1 = 7 

Question No: 8 ( Marks: 1 ) - Please choose one 
C is widely 
known as development language of _______ operating system. 
► Linux 
► Windows 
► Unix (Pg 12)
► Mac OS 

Question No: 9 ( Marks: 1 ) - Please choose one 
What will be 
the result of arithmetic expression 6+27/3*3? 
► 33 
► 45 
► 9 
► 30 

Question No: 10 ( Marks: 1 ) - Please choose one 
How many 
bytes are occupied by declaring following array of characters?
char str[] = “programming”;
► 10 
► 11 
► 12 
► 13