C++ :: Daily Interest Rate For Savings

Jun 7, 2013

I am making this program for a class and it works fine except for the daily interest rate for the checking account is off. The daily interest for the savings computes perfectly. The monthly interest rate for savings is 6% and for checking 3%.

Account.h

#ifndef ACCOUNT_H
#define ACCOUNT_H
#include <iostream>
#include <string>
using namespace std;
const int DAYS_PER_MONTH = 30;

[Code] ....

View 1 Replies


ADVERTISEMENT

C++ :: Loan Payment Table - Top Increments And Interest Rate

Apr 7, 2014

I have a problem requiring me to :
enter loan amount:
Enter interest rate:
Enter length of loan (years)

It wants me to input the minimum amount for the loan, and the minimum interest rate. and then output a table that has 5 loan amounts across the top in $10000 increments and 4 interest rates along the side in .25% increments.

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main () {
double loan, interest, length, payment,ti;
//Enter loan price

[Code] .....

View 1 Replies View Related

Visual C++ :: Building A Savings Account Program?

Mar 12, 2014

#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

[Code].....

I need to modify the program to use annual interests rates of 3%, 4%, and 5%.

After that I need to modify the program to make it so the user enters the dollar amount of the deposit, the interest rate or rates, and the number of years.

I'm a design student at New England Tech but before we can go full design they want to make sure we know for sure if we want to be a designer or a programmer and so we need to take C++ classes

View 4 Replies View Related

C++ :: FFMPEG - Dynamic Change Of Bit Rate For Video

Apr 11, 2012

I use ffmpeg codes in my C++ app and would like to control the bit_rate parameter for VIDEO there. I tried to change its value in work (via ost->st->codec->bit_rate = 150000), but ffmpeg did not wish to change it.

I tried to make re-init of the codec:

Code:
....
ost->st->codec->bit_rate = 150000;
AVCodecContext* newContext = avcodec_alloc_context3(ost->enc);
avcodec_copy_context(newContext, ost->st->codec);
avcodec_close(ost->st->codec);
av_free(ost->st->codec);
ost->st->codec = newContext;
avcodec_open2(ost->st->codec, ost->enc, &ost->opts);

the program hanged after that codes.

View 2 Replies View Related

C++ :: Compound Interest Formula

Jun 21, 2013

Equation for compound interest. The interest is supposed to be $43.34 according to the book, I am ending up with around $35. The actual equation is amount = principal * (1 + rate/t)^t where t = number of times compounded per year. I still have to go through and clean up all the code I just want the formula working first.

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main () {
float princ, rate, comp, savings, interest, rates, year;

[Code] .....

View 2 Replies View Related

C :: Linux Socket Multiple Connections But With Different Time Rate

Feb 6, 2015

i want to write a server and a client as below:

The server(and not the clients) will connect to the clients and just send a message. The idea is to be able to connect at each client a different time.

e.g
every 10mins connect at client 1
every 2mins connect at client 2
every 1hour connect at client 3
and so on...

So how to implement this ? Should i create a new child process for each connection and what about the timing ? A pseudo code also will work.

View 4 Replies View Related

C++ :: Using Overloaded Function To Calculate Weekly Rate Of Employees

Aug 5, 2013

The question involves me writing a program using a overloaded function to calculate the Weekly rate of employees but they get paid hourly and weekly. I get this error but do not know why,

#include <iostream>
using namespace std;
int calcWeeklyPay(int paidWeekly, int annualSalaryWeekly)
//Returns the Weekly salary of weekly paid Employees
int calcWeeklyPay(int paidHourly, int annualSalaryHourly)
//Returns the Weekly salary of Hourly paid Employees

[Code]...

View 3 Replies View Related

C++ :: Compound Interest Formula Coding

Sep 24, 2014

Im having problems coding this
A = P(1 + r/n)nt

//Declared test cases
float principal = 200000.00, annualInt = 0.03;
float years = 10.0;

float calcInterest1(float principal, float years, float annualInt) {
float interest1;
float nt = annualInt*12;
float A = principal+annualInt;//Accrued Amount
interest1 = (A = (principal*(1+years/100))pow(nt));// A = P(1 + r/n)nt
return interest1;
}

View 1 Replies View Related

C++ :: Calculate Simple Interest Using Functions

Jan 17, 2013

I was trying to make a program of calculating simple intrest using functions. I don't know whats wrong with the program but it always shows a wrong output.

#include<iostream.h>
#include<conio.h>
float si(int p,int r,int t) {
return ((p*t*r)/100.0);

[Code] ....

View 4 Replies View Related

C/C++ :: Interest Calculator Math Part

Feb 11, 2014

math part.

The equation I need to use is: payment = [(rate * (1 + rate)^number payments ) / ((1 + rate)^number of payments -1)] * loan

Also, the value of rate in the above equation is (interest/12)/100. So 12% annual interest would be 1% monthly interest.

heres my code:

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

[Code].....

View 4 Replies View Related

C++ :: Payroll Program - Number Of Hours An Employee Worked / Pay Rate

Oct 5, 2014

Write a payroll program that prompts for the number of hours an employee worked, as well as the employee’s pay rate. If the employee worked for 40 hours or less, the gross pay is calculated by multiplying the number of hours worked by the pay rate. If the number of hours worked by the employee exceeds 40 hours, the employee should receive regular pay for the first 40 hours, and receive time-and-a-half pay for the hours in excess of 40. Display the calculated gross pay on the screen.

Continue to prompt for similar data for more employees and have the gross pay of each employee displayed, until there is no more employee data to process. Then display “Good Bye”.

Your solution must be separated into three source files (Interface, Implementation, and Test)

View 3 Replies View Related

C++ ::  converting Output Of Simple Interest To Float

Sep 27, 2013

Here is my code:

int main (int argc, char* argv[]) {
int x = atoi (argv[1]);
int y = atoi (argv[2]);
int z = atoi (argv[3]);
if (strcmp(argv[4], "Simple") == 0){

[Code ....

I need to convert the output of simple interest to float which is $5184.90 instead of $5180. how to go about it?

View 3 Replies View Related

C/C++ :: Calculating Interest Earned On Bank-account

Oct 21, 2014

This exercise should familiarise you with loops, if-then-else statements, and recursion. You will have to design and implement a program that calculates the interest earned on a bank-account. Deadline is the end of Tuesday in week 4.

Interests are compounded; that is, you earn interest on interest. Given a yearly interest rate of say, 6%, you can calculate the total sum available when an initial sum of 4000 pounds is put away for 13 years as follows:

4000 * ( (1 + [6/100])^13 ) = 8531.71 pounds

where the caret symbol denotes 'to the power of'. One way to calculate the power is by repeatedly mulitplying. Ie, you can mulitply 1.06 with 1.06 12 times to calculate 1.06^13.

PART 1

Design and implement a function that raises X to the power Y for a real number X and a positive integer Y. The function must use a while loop.

Design and implement a main program that calculates the sum availble when 1000 pounds has been put away for 25 years with 5 percent interest.

Change the while-loop in the function to a for-loop.

View 12 Replies View Related

Visual C++ :: Calculating Shipping Charges - Amount Always Comes Up As Flat Rate Variable

May 14, 2015

I'm currently working on a program that calculates shipping charges. However I'm stuck, whenever I compile the program the total amount at the end always comes up as my flat rate variable and not the total calculated number.

Code:
#include <iostream>
#include <iomanip>
#define FLAT_FEE 5
using namespace std;
int main() {
double num, pound, ship;
ship = FLAT_FEE;

[Code] ....

View 6 Replies View Related

C++ :: Calculating Interest And Making Nested Loops Not Working

Feb 4, 2013

For each quarter, calculate and display the beginning principal balance, the interest earned, and the final principal balance for the quarter.For example: The user entered 1000.00 for the beginning principal balance, 5.25 for the interest rate, and 8 for the number of quarters. The output from this part of the program should be similar to the following:

Q| Beginning Principle| Interest Earned| End Principle
1| $1,000.00 | $13.13 | $1,013.13
2| $1,013.13 | $13.30 | $1,026.42
3| $1,026.42 | $13.47 | $1,039.89
etc

Here is the code I have so far, and I just am not quite sure where to go next.

Code:

{
cout << "Quarters" << " " << "Beginning Principles" << " " <<"Interest Earned" << " " <<"End Principal" << endl;
endprin = balance + (quarter * interest);
interest = quarter * interest;
cout << endprin << endl;

}

View 2 Replies View Related

C++ :: Calculate Simple Interest Of Given Loan Amount And Duration In Years

Jan 25, 2013

Your objective is to write a program that calculates the simple interest for a given loan amount and duration (in years).

Formula:

Simple interest = loan amount X interest rate X number of years
Assume interest rate is a constant 6% per year.

Specifically, your program will:
1. Output descriptive header
2. Prompt and read any customer’s first name, middle initial, and last name individually
3. Prompt and read the principal/loan amount
4. Prompt and read the duration of the loan in years
5. Calculate the interest
6. Output:
a. Customer full name
b. Principal/loan amount
c. Duration of loan
d. Interest rate
e. Interest on loan
f. Principal and interest due at end of term

OK SO THIS IS MY PROGRAM SO FAR. As you can see i got it all but i am so confused with as to for loan amount and duration of year, if i should use float or double to declare it?

i need to finish this assignment by calculating the simple interest and i dont know how or where to begin.

int main(){
system("color f0");
string firstName;
string middleInitial;
string lastName;
cout<<"Please enter your First Name: ";

[Code]...

View 1 Replies View Related

Visual C++ :: Calculate Amount Paid To Employee Based On Hours Worked And Rate Per Hour

Oct 8, 2013

Write a program in C++ that calculates the amount to be paid to an employee based on the hours worked and rate per hour. A user will enter hours worked and rate per hour for an employee. Your program should have a function payCheck that calculates and returns the amount to be paid. The formula for calculating the salary amount is as follows: for the first 40 hours, the rate is the given rate (the rate that a user has entered); for hours over 40, the rate is 1.5 times the given rate.

I had write my own coding, but it keeps error. it is okay. But i still don't think i could share here? Still running... I will update my coding for you alls to check for any syntax or logic error. The problem is i need to calculate if the employee work for more than 40 hours which 1.5 times.

Code:
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>
using namespace std;
int main(void) {
char *empname, *test, *final_output;

[Code] .....

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved