We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

See Pricing

What's Your Topic?

Hire a Professional Writer Now

The input space is limited by 250 symbols

What's Your Deadline?

Choose 3 Hours or More.
Back
2/4 steps

How Many Pages?

Back
3/4 steps

Sign Up and See Pricing

"You must agree to out terms of services and privacy policy"
Back
Get Offer

Assignment: Prime Number and Real Life Problems

Hire a Professional Writer Now

The input space is limited by 250 symbols

Deadline:2 days left
"You must agree to out terms of services and privacy policy"
Write my paper

The purpose of this assignment is to understand and implement the basic if else ND 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 0.

Don't use plagiarized sources. Get Your Custom Essay on
Assignment: Prime Number and Real Life Problems
Just from $13,9/Page
Get custom paper

There is a surcharge of $100 if the driver is under 25 and an additional surcharge for accidents: # of accidents Accident Surcharge 2 3 4 5 6 or more 50 125 225 375 575 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 I 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 the activity factor by the person’s weight to get the recommended number of lories. Start your program by: having the user enter their weight, as a floating point number; having the user enter whether they have active or sedentary lifestyle, as a character, ‘A’ for active or ‘S’ sedentary; use selection statement to use the appropriate calculation for the recommended calories for the selected lifestyle; print out your results on the screen. . Write a program which reads a year (integer) from the user and decides whether that year is a leap year. A year is a leap year (and so contains a February 29) if it is divisible by 4. But if the year is also divisible by 100 then it is onto leap ear, unless it is divisible by 400. This means that years such as 1992, 1996 are leap years because they are divisible by 4 and are not affected by the rest of the rule which applies to century years such as 1900 and 2000. Century years are not leap years except where they are a multiple of 400.

Hence, the years 1700, 1800 and 1900 were not leap years and did not contain a February 29. But the year 2000 was a leap year, the first such century leap year since 1600. 6. Write a program that reads a date from the user in numeric form. For example, February 17, 2003 would be entered as the three integers 2, 17, and 2003. Your program just then determine if the date is a “valid” date. Use the following information to determine if the date is valid: January, March, May, July, August, October, and December all have 31 days.

April, June, September, and November all have 30 days. February has 28 days in a non-leap year and 29 days in a leap year. Echo the input and print either “valid date” or “invalid date” as output.

Cite this Assignment: Prime Number and Real Life Problems

Assignment: Prime Number and Real Life Problems. (2018, May 15). Retrieved from https://graduateway.com/assignment-prime-number-and-real-life-problems/

Show less
  • Use multiple resourses when assembling your essay
  • Get help form professional writers when not sure you can do it yourself
  • Use Plagiarism Checker to double check your essay
  • Do not copy and paste free to download essays
Get plagiarism free essay

Search for essay samples now

Haven't found the Essay You Want?

Get my paper now

For Only $13.90/page