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

  • Satisfactory Essays

    a1 script win213

    • 380 Words
    • 2 Pages

    If the user does not enter a numeric value the program should prompt for a numeric value…

    • 380 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    = z) return true; else return false; } Problem 5 a. Output: 720 b. Output: 0 c. Output: 71 d. Output: 362880 Problem 6 a. Output: “Take Programming I.” b. Output:…

    • 188 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    PT1420 Chapter 3 Review

    • 1062 Words
    • 8 Pages

    6. Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0.…

    • 1062 Words
    • 8 Pages
    Satisfactory Essays
  • Good Essays

    It/210 Final Exam

    • 1235 Words
    • 5 Pages

    5. The program will allow the user to clear all the input fields and do the calculations over.…

    • 1235 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Accident Coverage at $350 a year. This covers all participants and staff members on the job and in traveling to and from Policyholder sponsored events/activities. Breakdown of coverage pricing; full principle sum for loss of life ($10,000), full principle sum for double dismemberment ($10,000), 50% of the principle sum for loss of one hand, one foot, or sight of one eye ($5,000), and 25% of the principle sum for loss of index finger and thumb of same hand…

    • 628 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    CEIS100 W5 ILab Report

    • 320 Words
    • 2 Pages

    The objective was to create a program using python. The program should successfully ask the user to input his or her name. Then ask the user to enter his or her age. If they are older than 16 then they can drive a car. Display this message along with their name. Then end the program by stating the users name, and that it is nice to meet them.…

    • 320 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    pt1420 exam review

    • 738 Words
    • 3 Pages

    1 - Design the Program2 - Write the Code3 - Correct Syntax Errors4 - Test the Executable Code…

    • 738 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    UNIT 2

    • 470 Words
    • 3 Pages

    5.) Write the pseudocode for a program that will determine the average miles per gallon a car gets. (Inputs should be miles driven and gallons of gas used)…

    • 470 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    4. Calculate your BMR using online tools. Based on your BMR, calculate your daily calorie needs.…

    • 2727 Words
    • 9 Pages
    Good Essays
  • Powerful Essays

    6. Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0.…

    • 748 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    carloe :)

    • 253 Words
    • 2 Pages

    Problem 1: Write an application that prints every integer value from 1 to 20 along with the squared value of each integer.…

    • 253 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Prime Number

    • 1326 Words
    • 6 Pages

    Julia cut a string 8.46 m long into 6 equal pieces. What is the length of each piece of string?…

    • 1326 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    Hello

    • 888 Words
    • 4 Pages

    1) prompt the user to enter an integer N (in this document we call the input number N, but of course…

    • 888 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    IN PARTIAL FULFILMENT OF THE REQUIREMENT FOR THE AWARD OF HIGHER NATIONAL DIPLOMA (HND) IN COMPUTER ENGINEERING TECHNOLOGY.…

    • 1538 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    slips

    • 5191 Words
    • 38 Pages

    A) Write a C Program to accept a four digit number from user and count zero , odd…

    • 5191 Words
    • 38 Pages
    Good Essays