subject
Computers and Technology, 07.07.2020 16:01 heydisr

A bank in your town updates its customers’ accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must maintain a minimum balance. If a customer’s balance falls below the minimum balance, there is a service charge of $10.00 for savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows: a. Savings accounts receive 4% interest.
b. Checking accounts with balances of up to $5000 more than the minimum balance receive 3% interest; otherwise, the interest is 5%.
This Java program using Eclipse Indigo reads a customer’s account number ( int type ), account type ( char type; s or S for savings, c or C for checking), minimum balance that the account should maintain, and current balance. The program should then output the account number, account type, current balance, and new balance or an appropriate error message. Test program by running it five times, using the following data:
46728 S 1000 2700
87324 C 1500 7689
79873 S 1000 800
89832 C 2000 3000
98322 C 1000 750
[code]
import java. util.*;
public class bank
{
public static void main (String [] args)
{int num, error=1,itype=0;
char type =0;
double min, cur =0,balanc =0,rate=0;
Scanner in=new Scanner(System. in);
System. out. println("Enter account number: ");
num=in. nextInt();
while(error==1)
{
System. out. println("Enter account type(s-savings or c-checking):");
type=in. next().charAt(0);
if(type=='c'||type=='C')
{itype=1;
error=0;
rate=3/100.;
}
else if(type=='s'||type=='S')
{itype=0;
error=0;
rate=4/100.;
}
if(error==1)
System. out. println("Invalid type-re enter");
}
System. out. println("Enter minimum balance: ");
min=in. nextDouble();
System. out. println("Enter current balance: ");
cur=in. nextDouble();
balance = cur;
if(itype==1)
{ if(cur>min+5000)
rate=5/100.;
else if(cur cur-=25;
}
else
if(cur cur-=10;
cur=cur+rate*cur;
System. out. printf("After interest and fees your balance is = $%.2f\n",cur);
System. out. println("Your account number: " + num);
System. out. println("Your account type: " + type);
System. out. printf("Your starting balance: $%.2f\n ", balanc);
System. out. printf("Your new balance: $%.2f\n", cur);
}
}
[/code]

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
question
Computers and Technology, 23.06.2019 02:50
Define a class named movie. include private fields for the title,year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie.write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields.this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie.settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie.setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie.setdirector(temp); //display all the data myfavoritemovie.displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie.cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
Column a of irma’s spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
You know the right answer?
A bank in your town updates its customers’ accounts at the end of each month. The bank offers two ty...
Questions
question
English, 23.10.2021 05:10
question
English, 23.10.2021 05:10
question
Mathematics, 23.10.2021 05:10
Questions on the website: 13722361