C++ :: Calculate Balance Of Saving Account At The End Of Three Month Period
Dec 11, 2014
(I'm using visual c++). Write a program that calculates the balance of a savings account at the end of a three month
period. It should ask the user for the starting balance and the annual interest rate. A loop should then iterate once for every month in the period, performing the following:
A) Ask the user for the total amount deposited into the account during that month. Do not accept negative numbers. This amount should be added to the balance.
B) Ask the user for the total amount withdrawn from the account during that month. Do not accept negative numbers or numbers greater than the balance after the deposits for the month have been added in.
C) Calculate the interest for that month. The monthly interest rate is the annual interest rate divided by 12. Multiply the monthly interest rate by the average of that month’s starting and ending balance to get the interest amount for the
month. This amount should be added to the balance.
After the last iteration, the program should display a final report that includes the following information:
• starting balance at the beginning of the three-month period.
• total deposits made during the three months
• total withdrawals made during the three months
• total interest posted to the account during the three months
• final balance.
What I need is to solve that particular problem using a class. Here is the code solved for the problem not using a class:
#include<iostream>
using namespace std;
int main() {
double annulInterestRate,
balance,
monthlyInterestRate,
[Code] .....
View 8 Replies
ADVERTISEMENT
Sep 22, 2013
so i am just hitting writers block on this one... its lengthy and i am very little into it...
The program takes 4 entered values (total loan, apr, monthly payment, and length of loan).
It is to put out a table that gives the new loan balance each month and the total interest payed at the bottom.
View 2 Replies
View Related
Mar 17, 2013
i am beginner in c++ , i need to write a programm that out ouputs a calender for a month when given a month and year using this frame work :
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
using namespace std;
[code].....
View 8 Replies
View Related
Oct 29, 2013
program that prompts the user to enter a person’s date of birth in numeric form such as 8-27-1980.The program then outputs the date of birth in the form: august 27, 1980.Your program must contain at least two exception classes; invalidDay and invalidMonth.
View 1 Replies
View Related
Oct 18, 2013
I have an application this is already license but in this application use my functionality put custom .afl file this file make in c++ make this .afl file as trial period.So how to make this .afl file as 7 day trial period....
View 2 Replies
View Related
Jul 14, 2012
I'm trying to create a program to balance a checkbook. In the program, I want to be able to list the deposits and withdrawals individually, as well as the total deposits, total withdrawals, beginning and ending balances. I am trying to set up two different arrays to do this, but how to set them up the right way.
Code:
//checkbook.cpp
//EmilyBattaglia
//final project part C
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
//declare variables
[code].....
View 1 Replies
View Related
Jul 2, 2014
So if I have an array how do I convert it to a balance binary tree?
View 1 Replies
View Related
Feb 1, 2014
I receive this error, been couple hours try to understand, but i havent find the solution.
i get the error here:
case 2:
currentBalance(balance);
main ();
is it because it doesnt have a value, i serious dont know what my problem.
My whole code.
// Lucky ATM.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
[code]....
View 13 Replies
View Related
Oct 25, 2014
I have part of it done but im not sure how to get my amount balance to get into my other functions from my file...
#include<iostream>
#include<fstream>
using namespace std;
void welcomeUser();
bool readFile();
void menu();
[Code] ....
and the amount saved that I have in the file is 1200
View 14 Replies
View Related
Apr 8, 2014
I don't really have an issue with the math behind this, rather it's more with the code structure itself. Basically, every row is right, except for the last row. The last row (year) needs to be depreciated by the value at the beginning of the last row (year).
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
[Code]......
View 2 Replies
View Related
Jul 1, 2013
I'm trying to determine the first Tuesday of any month in a given year.. I'd prefer to use my own functions to arrive at a solution, but logically I could sorting these things out.
View 6 Replies
View Related
Dec 17, 2013
I write this program to print the number of days for the month when the year and the month enters. This is not giving any result and i think that problem is with calling functions.
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
int leap_year(int year);
string days(string mounth);
string feb(string fab1);
void main(){
int year;
View 8 Replies
View Related
Apr 10, 2013
I am having trouble associating the month names with the month numbers. When the program runs, it should output the date in three styles.
Also I do not know if my input validations work correctly(day cannot be greater than 31 or less than 1, month cannot be greater than 12 or less than 1).
#include <iostream>
using namespace std;
char again;
class Date {
private:
int month;
int day;
int year;
[Code] ....
View 7 Replies
View Related
May 18, 2013
Write a program to calculate the Loan Balance, where a person borrows an amount A and in return he/she agrees to make N payments per year, each of amount P. While the person is repaying the loan, interest will accumulate at an annual percentage rate of R, and this interest will be compounded N times a year (along with each payment). Therefore, the person must continue paying these installments of amount P until the original amount and any accumulated interest is repaid.
NOTE: The formula to calculate the amount that the person needs to repay after T years is-
Balance Amount after T years = A[(1+R/N)^NT]-P
-----------------------------------------------------------
I have a few doubts :
1. I think that the "balance amount" formula can directly give the "loan balance" for the person. I'm not sure if it's correct but in that case the question would serve no purpose. Maybe I'm wrong.
2. If there should be a loop to calculate the loan balance, what condition should I give and which loop will be better to use?
View 11 Replies
View Related
Mar 24, 2014
I had a quick question about how to check the balance of brackets in an HTML file using a stack (pushing and popping). I understand pushing and popping. I get lost when it comes to the logic of having to actually check what is in the brackets, and making sure those are nested correctly.
So while
<title><b> THIS FILE </b> USES CORRECTLY NESTED TAGS </title>
is correct and
<title> <b> THIS FILE </title> IS </b> NOT NESTED CORRECTLY.
is incorrect;
How do I check for the actual tags inside the brackets, keeping in mind that there are single sided tags as well.
(ex. <img src="a.jpg"/>)
View 8 Replies
View Related
Oct 21, 2013
So my program is suppose to calculate the rain totals for the month but I get a weird error I've never seen.
ERROR: Unresolved external symbol "double_cdecl wettestMonth(double*const,int)" (?wettestMonth@@YANQANH@Z) referenced in function_main
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
//Function Prototypes
double getData();
[Code] ....
View 1 Replies
View Related
May 2, 2013
The objective is to build a month class that hold data on the number of the month and the name of the month. Using constructors and overloads, set it up to where you can input either the month or the name and it will output the results for both the month number and name.
Here is the code I have so far:
#include<iostream>
#include<string>
using namespace std;
class Month{
private: string name;
int monthNumber;
[Code] ....
It is almost fully compiled if I go by the error list. The only problems I see to be having are with the prefix and postfix overloads.
View 5 Replies
View Related
Jun 13, 2014
I am running a little business on the side, any program I could use that will show me the balances of clients after withdrawals, deposits. For example, if i had a data file like this :
Code:
e 5 Elden
c 3 Felipe 55342.51415
e 3 Leonardo
e 1 Yong
[Code] ....
Lines beginning with 'e' will have an integer employee ID and an employee name.
Lines beginning with 'c' will have an integer customer ID, customer name, and a floating point account balance.
Lines beginning with a 't' will have a customer ID, employee ID, a 'w' or 'd' representing withdrawal or deposit,
and a floating point transaction amount.
Now, obviously the program doesn't have to be exactly like this but something along these lines.
View 4 Replies
View Related
Oct 18, 2013
So for my C++ class I am required to create a program that will "Write a program to generate a calendar for a year. The program should accept the year and the day of the week for january 1 of that year (0=Sunday, 1=Monday, etc.)" (problem statement) and I am completely stuck. I've posted what I have so far below:
#include <iostream>
#include <iomanip>
using namespace std;
bool isLeapYear(int year);
int daysInMonth(int month, bool lpYear);
int printCalendar(int month);
int printDay(int dow);
[Code] .....
View 3 Replies
View Related
Nov 10, 2014
In this assignment the student should develop a month calendar by designing a class called calendarType . This class uses two other classes (dateType and dayType) as described below:
1. dayType Class: This class has been designed by students in Lab1 exercises. Referee to it.
2. dateType Class: This class is designed and implemented to keep track of data. This class has been provided it to you. Study it first then add definitions and implementations of the following operations to this class:
- Test whether the year is a leap year. Leap year is identified by 3 criteria :
- The year is evenly divisible by 4;
- If the year can be evenly divided by 100, it is NOT a leap year, unless;
- The year is also evenly divisible by 400. Then it is a leap year.
- Return the number of days in the month. For example, if the date is 12/3/2014, the number of days to be returned is 31 because there are 31 days in March.
- Return the number of days passed in the year. For example, if the date is 18/3/2014 the number of days passed is 77. Note that the number of days returned also includes the current day.
- Return the number of days remaining in the year. For example, if the date is
18/3/2014 , the number of days remaining in the year is 288.
- Calculate the new date by adding a fixed number of days to the date. For example, if the date is 18/3/2014 and the days to be added are 25, the new date is 12/4/2014.
To print monthly calendar using calendarType class, you must know the first day of the month and the number of the days in that month. Thus, you must store the first day of the month, which is in the form of dayType and the month and the year of the calendar. Clearly, the month and the year can be stored as an object of the form dateType by setting the day component of the date to 1, and the month and year as specified by user.
Design the class calendarType so that the program print a calendar for any month starting 1/1/ 1500 which is Monday. To calculate the first day of a month, you can add the 2 appropriate days to Monday of January 1, 1500. For this class identify and implement the following operations:
- Determine the first day of the month for which the calendar will be printed. Call this operation firstDayOfMonth.
- set/get month.
- set/get year.
- Print calendar for particular month.
- Add the appropriate constructors to initialize the member variables.
- Write a test program to print the calendar for either a particular year or a particular month.
View 1 Replies
View Related
Apr 11, 2013
It is suppose to display the message "This Account ID does not exist" but why do I get "segmentation fault"??I was able to compile and run the program so it shouldn't be a problem of the compiler.
Code:
#include <stdio.h>#include <string.h>
struct Account {
char* Account_ID;
char* Account_Type;
char* AccountOwner_FirstName;
char* AccountOwner_LastName;
float* Balance;
[Code]....
View 11 Replies
View Related
Dec 16, 2013
I'm trying to do is write a program that fits to a separate test program. The test program provides different size vectors that my function should try and binary search. If the element is found, the function should return 1, and if the element is not found, it returns -1.
Here is the code:
int binSearch(const vector<double> & data, int elem, int & comps) { {
int beg=data[0];
int end=data[data.size()-1];
int mid=(end+beg)/2;
[Code] ......
The problem is that one of the vectors my function is supposed to binary search is a vector of size 0. I tried to throw in an if statement that would return -1 if the size was == 0, but then the program never fully completed and just kept running. So, how can I account for a size 0 vector in my function?
View 2 Replies
View Related
Apr 21, 2013
as i am doing an encryption program on a playfair cipher. I am now stuck on a problem on decryption.If my string is helloworld (without a space), it will decrypt normally.However , if my string has a space in between it. Let`s say Hello World, it will not decrypt normally.How do i take into account the space that is in between hello & world?
example: hello world
View 4 Replies
View Related
Mar 18, 2014
I want to create user account and login to windows. I have to read username from DB and create window user for login to window. So,Can I create windows account and login to windows with C#
View 8 Replies
View Related
Dec 9, 2013
I am trying to make a for loop that will print out chars in an array while using a #define before main. My problem is that each name has a different amount of chars in it. How do you account for that when you are trying to define a size? For example, I am playing around with the numbers and I just put 7 in for size:
Code:
#include <stdio.h>
#define sizeOf 7
//char personName( char * name[] );
char printName ( char * name[]);
[Code] .....
View 8 Replies
View Related
Jul 27, 2013
So I'm trying to fill a vector with pointers to account objects.
std::vector<account*> fill_vector() {
std::vector<account*> temp;
std::ifstream s;
std::string str;
s.open("H://account2.dat");
[Code] ....
The accounts have four different types and I am supposed to skip over ones that have an invalid account type and throw an exception:
account* factory(std::string account_code, std::string first_name,
std::string last_name, char type, double balance) {
try {
if(type == 'A') {
simple_account *a = new simple_account(account_code, first_name, last_name, balance);
[Code] .....
My problem is they program will not skip over my rejected accounts.. still adds them to the vector but I cant figure out why!
View 8 Replies
View Related