Preview

Assignment: Prime Number and Real Life Problems

Satisfactory Essays
Open Document
Open Document
693 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Assignment: Prime Number and Real Life Problems
CS101 Lab : Thursday group Assignment 2
Due: Monday, Sept 29, 2014(11:55Pm)
Assignment is only for cs101 Thursday group
If any one having Problem in understanding problem so you can ask me.(graduate office(G35) cs department)
Instructions:
Submit a soft copy of your code by Monday, Sept 29, 2014.
You are free to consult each other for verbal help. However copying or sharing the code with each other will not only result into the cancellation of the current assignment, it may impact your grade in all the future assignments and exams as well.

Assignment:
The purpose of this assignment is to understand and implement the basic if else and to understand how to use it for the real life problems.

1. write a program that convert pounds to kilogram and to print an error message if the weight entered in pounds is negative.

2. An Auto Insurance Program - Write a program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had. The basic insurance charge is $500. There is a surcharge of $100 if the driver is under 25 and an additional surcharge for accidents: # of accidents Accident Surcharge 1 50 2 125 3 225 4 375 5 575 6 or more No insurance

3. Prompt the user for a number and print good if the number is greater than 5, between 8 & 10 or greater than 33. Otherwise, print bad. Use the || operator in your if statement.

4. Write a program that recommends the number of calories a person should eat each day. Calories are units of energy found in all foods. Base your recommendation on the person's weight and whether the person has an active or sedentary(inactive) lifestyle. If the person is sedentary, that person's activity factor is 13. If the person is active, that person's activity factor is 15. Multiply

You May Also Find These Documents Helpful