408 views

Uploaded by Maryam Kausar

- Lec1 Introduction
- Lec9_C++
- Lec15_16_ Arrays
- Hint for Assignment 3, Q3
- Lec26 Networking
- CP S9 Gradesheet
- CP S8 Gradesheet
- Lec12_13_ControlStructures
- Lec 19-20-21-22 Pointers And Strings
- Lec8 Algorithms
- Lec17-18 Functions
- Lec14
- Sample Report
- Position holders in CP Final Exam
- Assignment 4 S8
- CS 1123 Computer Programming Outline Updated
- Lec4 Data Manipulation
- MATLAB
- Sample Algorithm- Assignment3
- Lec10_Constant Variables & ALU, Bitwise

You are on page 1of 2

Course Title Instructor Submission Date Weightage Computer Programming (for Engineers) Maryam Kausar 15th Oct for S9 and 16th Oct for S8 4% Absolute

Write algorithms and convert them into their equivalent pseudocodes of the following problems. 1. Write an algorithm that reads in the radius of a circle as an integer and prints the circle's diameter, circumference and area. Use the constant value 3.14159 for pi. 2. Assuming there are 7.481 gallons in a cubic foot, write an algorithm (and make its flowchart) that asks the user to enter a number of gallons, and then displays the equivalent in cubic feet.

3.

In the heyday of the British Empire, Great Britain used a monetary system based on pounds, shillings, and pence. There were 20 shillings to a pound, and 12 pence to a shilling. The notation for this old system used the pound sign, , and two decimal points, so that, for example, 5.2.8 meant 5 pounds, 2 shillings, and 8 pence. (Pence is the plural of penny.) The new monetary system, introduced in the 1950s, consists of only pounds and pence, with 100 pence to a pound. Well call this new system as decimal pounds. Thus 5.2.8 in the old notation is 5.13 in decimal pounds (actually 5.1333333). Write an algorithm (and make its flowchart) to convert the old poundsshillings-pence format to decimal pounds. An example of the users interaction with the program would be Enter pounds: 7 Enter shillings: 17 Enter pence: 9 Decimal pounds = 7.89

4. Write an algorithm that asks the user to enter two integers, obtains the numbers from the user, and then prints the larger number followed by the words "is larger." If the numbers are equal, print the message "These numbers are equal."

5. A worker is paid at the hourly rate of $8 per hour for the first 35 hours worked. Hereafter overtime is paid at 1.5 times the hourly rate for the next 25 hours worked and 2 times the hourly rate for further hours worked. Write an algorithm to input the number of hours worked per week, calculate and output the overtime paid.

6. The process of finding the largest number (i.e., the maximum of a group of numbers) is used frequently in computer applications. For example, a program that determines the winner of a sales contest inputs the number of units sold by each salesperson. The salesperson who sells the most units wins the contest. Write an algorithm (and make its flowchart) that uses a while statement to determine and print the largest number of 10 numbers input by the user. Your algorithm should use three variables, as follows: [4] counter: A counter to count to 10 (i.e., to keep track of how many numbers have been input and to determine when all 10 numbers have been processed). number: largest: The current number input to the program. The largest number found so far.

7. Write an algorithm (and make its flowchart) that prints the powers of the integer 2, namely 2, 4, 8, 16, 32, 64, etc. Your while loop should not terminate (i.e., you should create an infinite loop).

- Lec1 IntroductionUploaded byMaryam Kausar
- Lec9_C++Uploaded byMaryam Kausar
- Lec15_16_ ArraysUploaded byMaryam Kausar
- Hint for Assignment 3, Q3Uploaded byMaryam Kausar
- Lec26 NetworkingUploaded byMaryam Kausar
- CP S9 GradesheetUploaded byMaryam Kausar
- CP S8 GradesheetUploaded byMaryam Kausar
- Lec12_13_ControlStructuresUploaded byMaryam Kausar
- Lec 19-20-21-22 Pointers And StringsUploaded byMaryam Kausar
- Lec8 AlgorithmsUploaded byMaryam Kausar
- Lec17-18 FunctionsUploaded byMaryam Kausar
- Lec14Uploaded byMaryam Kausar
- Sample ReportUploaded byMaryam Kausar
- Position holders in CP Final ExamUploaded byMaryam Kausar
- Assignment 4 S8Uploaded byMaryam Kausar
- CS 1123 Computer Programming Outline UpdatedUploaded byMaryam Kausar
- Lec4 Data ManipulationUploaded byMaryam Kausar
- MATLABUploaded byMaryam Kausar
- Sample Algorithm- Assignment3Uploaded byMaryam Kausar
- Lec10_Constant Variables & ALU, BitwiseUploaded byMaryam Kausar
- CP Project Updated( Phase III and IV Swapped)Uploaded byMaryam Kausar
- Lec11_Expressions &Control StructuresUploaded byMaryam Kausar
- Lec7 DatabaseUploaded byMaryam Kausar
- Lec23-24 File HandlingUploaded byMaryam Kausar
- Lec2 Data StorageUploaded byMaryam Kausar
- Lec6 Operating SystemUploaded byMaryam Kausar
- CP MidTerm Marks S8Uploaded byMaryam Kausar
- Lec3 Data ManipulationUploaded byMaryam Kausar
- CP MidTerm Marks-S9Uploaded byMaryam Kausar
- Tips to Help in Mid-Term PreparationUploaded byMaryam Kausar

- Position holders in CP Final ExamUploaded byMaryam Kausar
- Good Luck on FinalsUploaded byMaryam Kausar
- S9 Friday DemoUploaded byMaryam Kausar
- Grading Policy of MAJUUploaded byMaryam Kausar
- Final Project Demo+ ReportUploaded byMaryam Kausar
- Project Report FormatUploaded byMaryam Kausar
- MATLABUploaded byMaryam Kausar
- String Quiz- S8 and S9Uploaded byMaryam Kausar
- S8 Thursday DemoUploaded byMaryam Kausar
- Lec25 StructuresUploaded byMaryam Kausar
- Lec23-24 File HandlingUploaded byMaryam Kausar
- S8 Monday LectureUploaded byMaryam Kausar
- S9 Pointer Quiz on MondayUploaded byMaryam Kausar
- S8 Thursday LectureUploaded byMaryam Kausar
- S8 &S9Uploaded byMaryam Kausar
- S8 Saturday Class and DemosUploaded byMaryam Kausar
- S9 Friday ClassUploaded byMaryam Kausar
- S8 and S9 TutorialsUploaded byMaryam Kausar
- S8 Demo of Phase II Moved to ThursdayUploaded byMaryam Kausar
- Lec 19-20-21-22 Pointers And StringsUploaded byMaryam Kausar
- Function Quiz S9Uploaded byMaryam Kausar
- Lec17-18 FunctionsUploaded byMaryam Kausar
- Sample ReportUploaded byMaryam Kausar
- Mid-Term Paper CollectionUploaded byMaryam Kausar
- Mid-Term Performance and What is Still LeftUploaded byMaryam Kausar
- CP Project Updated( Phase III and IV Swapped)Uploaded byMaryam Kausar
- CP MidTerm Marks S8Uploaded byMaryam Kausar
- CP MidTerm Marks-S9Uploaded byMaryam Kausar

- E1 - Engine Room LayoutUploaded byrahul yo yo
- Evidence Job InterviewUploaded byDiana Rl
- Latest RPMS Sy15-16Uploaded byMichelle Mallillin
- Panda ManualUploaded bychabane_148549
- Rock Climbing AbseilingUploaded bysamnewsy12
- Shortcut Keys v16.0.0Uploaded byNitesh Mehta
- vtu java 4th unit swingUploaded byprathik7425
- Sentinel-2 User HandbookUploaded byfadel muhammad
- English 8 Hh Prelim ExaminationUploaded byJahara Solaiman
- Public SuffixUploaded byBen Degler
- Exhibitor 32778Uploaded byMuhammad Naveed Rasool
- 03 Continuous BeamsUploaded byAnitha Hassan Kabeer
- Tolkāppiyam on intervocalic stopsUploaded bycha072
- Human Resources is a Term Used to Describe the Individuals Who Make Up the Workforce of an OrganizationUploaded byBhavna Dubey
- Interlinking Rivers of India is It NecessaryUploaded byebinVettuchirayil
- KM C2520 C3225 C3232 SM Rev7.0Uploaded byit_ady79
- chemistry lab reportUploaded byapi-341785642
- JDP 3-40.pdfUploaded byMark Reinhardt
- INFO4 Coursework Guide 2012-13Uploaded byJosh Crocker
- Www.efatigue1Uploaded byGeoffrey Armstrong
- Minecrete Brochure English PDFUploaded byCésar Estrella
- summativeplans-brandonkiUploaded byapi-275984739
- Scene Design – Between Profession, Art and IdeologyUploaded byLara Sánchez Coterón
- Building a Map Viewing Application Using the ArcGIS Engine CotrolsUploaded bysanok05
- The Evolution of Interventional RadiologyUploaded byChavdar
- Oliveti-ECR710 Cash RegisterUploaded byEmmanuel Lucky Ohiro
- VLSI ALU verilogUploaded byAbuturab Mohammadi
- Goffman the Presentation of Self PDFUploaded byAmy
- Pakistan's National Water Policy: An AppraisalUploaded byInstitute of Policy Studies
- lbp form2Uploaded byRobinson Quilantang