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

Assignment 01

Uploaded by

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

Assignment 01

Uploaded by

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

Assignment 1

(PLO1, CL01)
Lahore Garrison University
Department of Computer Sciences

Assignment No 1

Instructor Name: Ms. Batool Abbas Course Code: CSC373


Program/Semester: BSCS/1st Course Title: Programming Fundamentals
Semester: Spring 2023 Marks: 20

Read the instructions carefully:


I. Attempt all the questions.
II. Assignment must be solved in MS Word.
III. Assignment must be submitted in PDF form.
IV. Late submissions will not be accepted and marked as zero.

Q1. Demonstrate and print the first three characters of their name on separate lines in C++. (5)

Incorrect Partial Correct


Implementation Implementation Implementation
Rubric for Q1: (0-1 points) (2-3 points) (4-5 points)
The program does The program uses The program correctly
not use logical logical operators but uses &&, ||, and ! to check
operators or does not does not check all the conditions.
compile. conditions correctly.

Q2. Determine the expected output of provided code snippets. (3)

#include <iostream>
int main()
{
\* Comments *
std::cout<<"Hello world";
return 0; }

Incorrect Partial Correct


Implementation Implementation Implementation
Rubric for Q2: (0 points) (1-2 points) (3 points)
The program does The program uses The program correctly
not use logical operators but does checks the conditions.
operators or does not not check all
compile. conditions correctly.
Q3. Determine and describe the output of each of the following statements when given the initial values of x, y, and z as x = 10, y = 5,
and z = 5, applied to int variables. (5)

a. cout << "x = " << x << ", y = " << y << ", z = " << z << endl;

b. cout << "5 * x - y = " << 5 * x - y << endl;

c. cout << "Product of " << x << " and " << z << " is " << x * z << endl;

d. cout << "x - y / z = " << x - y / z << endl;

e. cout << x << " square = " << x * x << endl;

Incorrect Partial Correct


Implementation Implementation Implementation
Rubric for Q3: (0 points for each part) (0.5 point for each part) (1 point for each part)
The program does not use The program uses logical The program correctly
logical operators or does not operators but does not uses &&, ||, and ! to
compile. check all conditions check the conditions.
correctly.

Q4. Determine and describe the output of the given statements, with a being an int variable initialized to 25, b being an int
variable initialized to 20, and c being a double variable initialized to 5.0. (7)

a. cout << a * 2 * b << endl;

b. cout << a + b / 2.0 + 1.5 * c << endl;

c. cout << a / (b) << endl;

d. cout << 62 % 28 + a / c << endl;

e. cout << (c) % 3 + 7 << endl;

f. cout << 22.5 / 2 + 14.0 * 3.5 + 28 << endl;

g. cout << 2 / (c – (c + 1.2))<< endl;

Incorrect Partial Correct


Implementation Implementation Implementation
Rubric for Q4: (0 points for each part) (0.5 point for each part) (1 point for each part)
The program does not use The program uses logical The program correctly
logical operators or does not operators but does not uses &&, ||, and ! to
compile. check all conditions check the conditions.
correctly.

You might also like