Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6574111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:13:10+00:00 2026-05-25T15:13:10+00:00

//Samuel LaManna //Program 1 (intrest rate) /*Variables: Principal=P Interest Rate=R Times Compounded=T Answer=A */

  • 0
//Samuel LaManna
//Program 1 (intrest rate)
/*Variables:
Principal=P
Interest Rate=R
Times Compounded=T
Answer=A */

#include <iostream>                                                                        //Input/output

using namespace std;

int main ()
{
  int P, R, T, A;                                                                          //Declaring Variables
  cout<<endl;
  cout<<"Interest Earned Calculator";                                                      //Prints program title
  cout<<endl;
  cout<<endl;
  cout<<"Please enter the Principal Value: ";
  cin >> P;
  cout<<endl;
  cout<<endl;
  cout<<"Please enter the Interest Rate (in decimal form): ";
  cin >> R;
  cout<<endl;
  cout<<endl;
  cout<<"Please enter the Number of times the interest is compounded in a year: ";
  cin >> T;
  cout<<endl;
  cout<<endl;
  A=P*((1+R)/T)^T;
  cout<<"Interest Rate", cout<<R;
  return 0;
}

When it gets to were it does the equation and starts outputting it gets all messed and thrown together. Its a simple interest calculator app.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:13:10+00:00Added an answer on May 25, 2026 at 3:13 pm

    I’ll guarantee that, if you’re doing interest rate calculations (or anything else requiring floating point accuracy), you should not be using an int data type.

    In addition ^ is not the power operator, it’s the exclusive-or operator. You need to look into the pow standard library function.

    That should hopefully be enough for you to figure out why your homework is misbehaving, without me doing all the work for you.

    Aside: The construct

    cout<<"Interest Rate", cout<<R;

    is a pretty rare one. It may work (I don’t know off the top of my head whether the comma operator is a sequence point and I’m too lazy to go look it up at the moment), but you should probably prefer something like the more usual:

    cout << "Interest Rate: " << R << endl;

    And you probably want to output A (the answer) at some point 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display the apostrophe 's after the full name for example Samuel
This program is giving me a full screen of errors when i try to
String obj = null; obj= new String(Samuel); //vs String obj = null; obj=Samuel; Is
In ActiveRecord how can we update a record without worrying/knowing primary key. If I
I would like to know if there is a way to view all the
-(IBAction)printDisplay:(id)sender{ CGRect rect = CGRectMake(0.0,44.0,self.view.frame.size.width,self.view.frame.size.height); NSValue *rectObj = [NSValue valueWithCGRect:rect]; CGRect rectRestored = [rectObj
I have an assignment and i got a library including an interface class. [InfoItem]
The following code returns 14 as you'd expect: Block[{expr}, expr = 2 z; f[z_]
While reading the Java documentation on a Polygon, i discovered there is a getBounds
This might be a stupid question, but I notice that in a good number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.