Lab File Hamza Ansari(02-134181-081) BSCS 1B.docx - Computer Programming Practical Lab File S u b m i tt e d T o Submitted By Class Hamza

# Lab File Hamza Ansari(02-134181-081) BSCS 1B.docx -...

This preview shows page 1 - 4 out of 118 pages.

Computer Programming Practical Lab File S u b m i tt e d To : C l a s s : C o d e + C o u r s e : [ P i c k t h e d a t e ] Submitted By: Hamza Ansari (02-134181-081) Sir Tarwan Kumar BS(CS)-1B Spring 2018 CSL 113 + Computer Programming Lab
INDEX Lab # DATE Task # Objective Remarks Initial s 16 Feb 2018 1Draw a flowchart to read a student’s three grades, calculatethe average of the grades, then display the average grade? 3Draw a flowchart for a program that prompts the user toinput an integer value and tests if the input value is positiveor negative. The program displays an output messageaccording to the following cases:a. Input value is 0.b. Input value is positive.c. Input value is negative.4Draw a flowchart to reads the salary of an employee andprints:a) "Manager" → if the salary is above 20000,b) "Supervisor" → if the salary is above 15000,c)"Technician" → if the salary is above 8000.5We would like to predict the size of an insect population forthe week 3 and 4 based on data for week 1 and 2. Theweekly rate of growth is a percentage of the population atthe beginning of the week. Draw flow chart of this problem. 21Write a program that takes 3 values from user. Two values ofinteger and one value of float data type. Print each result onone line.2Write a program that gets 2 integers input from user andstore them in variables. Do the five basic ArithmeticOperations (+ , - , *, /, %) of the two numbers.3Write a program that prompt user to input course name,obtained marks and total marks. Calculate the percentageusing this formula marks percentage = marks obtained /total * 100.4Write a program that finds the value of X by using givenformula. Take value of a and b from user. X= (a + b)2 – 2ab 23 Feb 2018
5Write a program that plays a word game with the user. Theprogram should ask the user to enter the following:User’s nameYear of birth (eg. 1990)Name of universityA favorite hobbyA pet’s name6Write a C++ program that prompt user to enter value of Xand Y. You have to calculate the value of Hypotenuse (h) andArea(a).32March20181Write a C++ Program that read a float (amount) and an int(num) input from user. Add both (amount and num)numbers and store them in two different int (a) and float (b)variables. Display the outputs of a and b variables. Also ifoutputs are greater than 16 print “value of a & b > 16” elseprint “value of a & b < 16”.2Write a C++ Program that read three input from user andreturns the smallest one.3Write a C++ Program that read an alphabet (e.g. a,b,c,d,…..z)and display whether the input alphabet is a vowel (i.e. a, e, i,o, u) or consonant.4Write a C++ Program that read a number from user .Test theuser entered number whether it is EVEN or ODD. Print themessage that number is EVEN or ODD.5Write a C++ Program that read an integer input in between(1 to 12) and store it month_of_year. Print thecorresponding month of year. Use else if statement. Eample:Input is 4… Print “April”.6Rewrite exercise 5 using switch statement.

#### You've reached the end of your free preview.

Want to read all 118 pages?

• Fall '19