
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This assignment was given by Dr. Jyoti Lokesh at Biju Patnaik University of Technology, Rourkela for Computer Programming course. It includes: Modulus, Operators, Division, Individual, Digits, Palindrome, Display, While, Loop, Statement
Typology: Exercises
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Q#1: Write a program that reads a number N calculates and displays the reverse of N. e.g, 3465789 becomes 9875643. Hint: use the division and modulus operators to separate the number into its individual digits.
Q # 2 A palindrome is a number or a text phrase that reads the same backwards as forwards. For example, each of the following integers is a palindrome: 121, 55555, 4554 and 113311. Write a program that reads in a five-digit integer and determines whether it is a palindrome.
Q # 3 Write a program that reads numbers repeatedly until 0 (zero) is entered, find and display the smallest and largest number. Use while loop statement.
Q # 4 Write a program that read unsigned numbers in the range 10 – 60000 continually until 0 (zero) value is entered. Find and display how many numbers are completely divisible by 9, odd and even. Use while loop statement.
Q # 5 Write a program that uses a while loop statement to calculate and print the average of several integers. Assume the last value read is the sentinel 9999. A typical input sequence might be 10 8 11 7 9 9999 Indicating that the program should calculate the average of all the values preceding 9999.
Q # 6 Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording miles driven and gallons used for each tankful. Develop a program that uses a while statement to input the miles driven and gallons used for each tankful. The program should calculate and display the miles per gallon obtained for each tankful and print the combined miles per gallon obtained for all tankfuls up to this point.
Q # 7 One large chemical company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, sales person who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of $5000, or a total of $650. Develop a program that uses a while 2/5 statement to input each salesperson’s gross sales for last week and calculates and displays that salesperson’s earnings. Process one salesperson’s figures at a time.
Q # 8 Develop a program that uses a while statement to determine the gross pay for each of several employees. The company pays “straight time” for the first 40 hours worked by each employee and pays “time and a half” for all hours worked in excess of 40 hours. You are given a list of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee and should determine and display the employee’s gross pay.
Deadline: 30 th^ Nov 2011