5
Machine Problems : Decision Making and Branching Deadline: August 8, 2012 Guidelines: 1. Use proper naming convention for the file name of the program (i.e. fmp01, fmp02, and so on). 2. Put the comment below on the top part of the program: /* FMP No. __: This program will put the problem description here . Created by: ____________ ID Number: ____________ Date Created:___________ */ Source code here: # include<stdio.h> # include<iostream> using namespace std; int main() { ……….. //lines of codes system (“pause>0”); }

Decision Making and Branching

Embed Size (px)

DESCRIPTION

programming

Citation preview

Machine Problems: Decision Making and Branching

Deadline: August 8, 2012

Guidelines:1. Use proper naming convention for the file name of the program (i.e. fmp01, fmp02, and so on).

2. Put the comment below on the top part of the program:

/*FMP No. __: This program will put the problem description here . Created by: ____________ID Number: ____________Date Created:___________*/Source code here:# include# includeusing namespace std;int main(){..//lines of codessystem (pause>0);}

1. While purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000. If quantity and price per item are input through the keyboard, write a program to calculate the total expenses.2. The current year and the year in which the employee joined the organization are entered through the keyboard. If the number of years for which the employee has served the organization is greater than 3 then a bonus of Rs.2500/- is given to the employee. If the years of service are not greater than 3, then the program should not do anything.3. A company insures its drivers in the following cases:

If the driver is married

If the driver is unmarried, male & above 30 years of age.

If the driver is unmarried, female & above 25 years of age.

In all other cases the driver is not insured. If the marital status, sex and age of the driver are the inputs, write a program to determine whether the driver is to be insured or not.4. Write a program to calculate the salary as per the following table:

GenderYears QualificationsSalary

Male>=10Post-Graduate15000

>=10Graduate10000

=10Graduate9000