0% found this document useful (0 votes)
109 views3 pages

Assignment 1 - CSC 222 - Section 2102 PDF

This document contains an assignment for a Programming Language course. It includes 6 questions asking students to: 1) Differentiate objects, variables, and constants in C++. 2) Modify and correct a sample C++ program. 3) Write the output of a sample C++ program using operators. 4) Fill in a truth table evaluating a Boolean expression. 5) Write a C++ program using switch case to calculate geometric shapes' areas. 6) Develop a C++ application to generate a grade sheet for a student including ID, total marks, and grade.

Uploaded by

MalikAlrahabi
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)
109 views3 pages

Assignment 1 - CSC 222 - Section 2102 PDF

This document contains an assignment for a Programming Language course. It includes 6 questions asking students to: 1) Differentiate objects, variables, and constants in C++. 2) Modify and correct a sample C++ program. 3) Write the output of a sample C++ program using operators. 4) Fill in a truth table evaluating a Boolean expression. 5) Write a C++ program using switch case to calculate geometric shapes' areas. 6) Develop a C++ application to generate a grade sheet for a student including ID, total marks, and grade.

Uploaded by

MalikAlrahabi
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
You are on page 1/ 3

1440H-1441H: Second Semester

College of Engineering
Jazan University
Kingdom of Saudi Arabia

Assignment-1
Last date of 29/03/2019 Max. Marks:
Programming Language (CSC-222)
submission: Sunday 15
Section-2102

1. Differentiate among Object, Variable and Constant in C++ Programming [1.5 Marks]
Object Variable Constant

2. Make necessary modification and correction in the program and rewrite it. [1.5 Marks]
#include<iostream>
using namespace std;
int main() {
P, Q;
cin << P;
Q = P;
M = P / Q;
cout << "O = " << Q << endl;
cout << "M = " << M << endl;
getch();
return(0);
}
3. Write the output of the following program. [1.5 Marks]
#include<iostream>
using namespace std; (i) The value =
int main()
{ (ii) The value =
int P = 15, Q = 5;
cout << "\n The value=" << P / Q;
(iii) The value =

cout << "\n The value=" << P % --Q;


(iv) The value =
cout << "\n The value=" << P + ++Q;
cout << "\n The value=" << P++ *Q;
(v) The value =
cout << "\n The value=" << --P - --Q;
cout << "\n The value=" << P + ++Q;
(vi) The value =
return(0);
}

4. Filled up the Truth Table with the value T or F [1.5 Marks]


P Q R !((P&&Q) || (Q&&R))
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F
5. Write a program to calculate the area of Circle, Rectangle, Triangle and Square using
switch case statement. [3 Marks]

6. Develop an application program in C++ that will prepare the Grade Sheet of students
with the following details: [6 Marks]

Input Output
i. Accept student’s ID. i. Display the ID of the student
ii. Accept the marks of each course he has ii. Display Total marks he scored out of all
taken in the current semester (for courses.
example the student has taken 4 courses). iii. Display the Scored Grade of the student.
Like :

You might also like