Powered by Blogger.

Saturday, 26 November 2016

Assignment# 2 (ITP)

Share & Comment

Subject: Introduction to Programming 

Title: "Working with Operators and Flow charts"

Question #1

State the order of evaluation of the operators in each of the following C++ statements and show the value of x after each statement i s performed.
a)  x =7 + 3 * 6 / 2 - 1 ;
b)  x = 2 % 2 + 2 * 2 - 2 / 2 ;
c)  x = ( 3 * 9 * ( 3 + ( 9 * 3 /( 3 ) ) ) ) ;
d) x = 5 + 7 % 3;
e) x = 5 + (7 % 2);  
f) x = (5 + 7) % 5;
g) !(6 <= 4) evaluates true or false

Question #2
Let X=1 and Y=2 then determine whether each of the following expression is true or false.
Question #3
 X >Y OR X>0 AND Y<0         Evaluates true or false
Question #4

Draw flow chart for following
BEGIN
INPUT a
INPUT b
p = 1
a = a + ( P*3)
b= a *(p+1)
print a
print b
print p
END

Question #5

Draw a flow chart that takes unit consumed as input and calculates electricity bill as follows:
If units consumed are less than or equal to 300 then cost is Rs 3 per unit
If units are more than 300 then cost is 3.5 per unit and a surcharge of 5% is added to the bill

Instruction:
·      Assignments will be in printed form. Work using Microsoft Office word
·      Use the Cover page given in last assignment
·      Do your own work.

Click these links to access the complete file:

Dropbox: Assignment# 2

Google Drive: Assignment# 2

Tags: , ,

Written by

Hi friends, Shahzaib Jamal here. I am a developer to be 😊. I have very much interest in computer field and all the things that would make me better in this particular ground. I Chosed this field with a aim that one day i'll open my own Software Company. By keeping this interest in my mind i have made up this blog for you all by providing all the information on Developing subjects and other literary Subjects as well. " You will be pleased by surfing this stuff and hope it will become handy in the time of need"

0 comments:

Post a Comment

 

Popular Content

Contact Form

Name

Email *

Message *

Why to Choose BS(CS)?


  • Software Engineers
  • Database Designers
  • Database Administrators
  • Web Developers
  • Network Administrators
  • Software Quality Insurance and Testers
  • IT Consultants
Copyright © BSCS F16-S20 | Designed by SHAHZAIB JAMAL