Introduction to C Programming Assignment 4 | CS 102, Assignments of Computer Science

Material Type: Assignment; Class: INTRO TO C PROGRAMMING; Subject: Computer Science; University: University of Alabama - Huntsville; Term: Fall 2008;

Typology: Assignments

Pre 2010

Uploaded on 07/23/2009

koofers-user-1ev
koofers-user-1ev 🇺🇸

4

(1)

9 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS102 Introduction to C Programming
Assignment 4 Submission deadline date: 10/08/2008
Max Marks: 100 (50 points each problem)
1. Using Switch case, Write a C program that prints a menu which lets you choose your account type.
Once you have entered an account type, the program calculates an interest based on your account
type and displays the updated balance on the screen
Account types interest rates
General account 5%
Student account 6%
Business account 10%
Platinum account 15%
Senior citizen’s account 20%
Input
The program will need to prompt the user to enter the following
The type of the account
Current Balance present in the account
Number of years the amount has been present in the account
The program should read the above mentioned information from the keyboard.
Output
The program will calculate the interest generated for your account and print the updated balance on the
screen.
Formula to calculate interest = (P * N * R) / 100
P = Balance present in the account
N = Number of years the amount has been present in the account
R = interest rate
Formula to calculate updated balance = P + ((P * N * R) / 100)
i.e. the current balance + interest calculated
pf3

Partial preview of the text

Download Introduction to C Programming Assignment 4 | CS 102 and more Assignments Computer Science in PDF only on Docsity!

CS102 Introduction to C Programming

Assignment 4 Submission deadline date: 10/08/ Max Marks: 100 (50 points each problem)

  1. Using Switch case, Write a C program that prints a menu which lets you choose your account type. Once you have entered an account type, the program calculates an interest based on your account type and displays the updated balance on the screen Account types interest rates General account 5% Student account 6% Business account 10% Platinum account 15% Senior citizen’s account 20% Input The program will need to prompt the user to enter the following The type of the account Current Balance present in the account Number of years the amount has been present in the account The program should read the above mentioned information from the keyboard. Output The program will calculate the interest generated for your account and print the updated balance on the screen. Formula to calculate interest = (P * N * R) / 100 P = Balance present in the account N = Number of years the amount has been present in the account R = interest rate Formula to calculate updated balance = P + ((P * N * R) / 100) i.e. the current balance + interest calculated
  1. Use if-else statements to do the very same operation as stated above. However for Business account consider two subtypes (i) If balance > 100,000 –interest rate = 12% (ii) If balance <=100,000 – interest rate = 10% Account types interest rates General account 5% Student account 6% Business account (i) If balance > 100,000 –interest rate = 12% (ii) If balance <=100,000 – interest rate = 10% Platinum account 15% Senior citizen’s account 20% Input The program will need to prompt the user to enter the following The type of the account Current Balance present in the account Number of years the amount has been present in the account The program should read the above mentioned information from the keyboard. Output The program will calculate the interest generated for your account and print the updated balance on the screen. Formula to calculate interest = (P * N * R) / 100 P = Balance present in the account N = Number of years the amount has been present in the account R = interest rate Formula to calculate updated balance = P + ((P * N * R) / 100) i.e. the current balance + interest calculated