473,805 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

interest computation program

1 New Member
I am writing a project for class computing simple interest. The program compiles so I know my syntax is correct. My logic looks correct but its not giving me the correct answers. I think it has something to do with my specifications of the type of input. What kind of input (i.e. %d,%f,%lf,%Lf) would I use if the input such as interest was a simple decimal numer such as 0.0835? I'm not looking for the solution... just some help, figuring this out. Thanks
Sep 11 '07 #1
1 1422
ilikepython
844 Recognized Expert Contributor
I am writing a project for class computing simple interest. The program compiles so I know my syntax is correct. My logic looks correct but its not giving me the correct answers. I think it has something to do with my specifications of the type of input. What kind of input (i.e. %d,%f,%lf,%Lf) would I use if the input such as interest was a simple decimal numer such as 0.0835? I'm not looking for the solution... just some help, figuring this out. Thanks
To input a float, you should use "%f" with scanf().
Sep 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
2727
by: Michele Guidolin | last post by:
Hello to everybody. I'm doing some benchmark about a red black Gauss Seidel algorithm with 2 dimensional grid of different size and type, I have some strange result when I change the computation from double to float. Here are the time of test with different grid SIZE and type: SIZE 128 256 512
2
9527
by: johnywalkyra | last post by:
Hello, first of all sorry for crossposting, but I could not decide which group is more appropriate. To my question: Recently I've came across the code in GCC standard library, which computes the cube root of a real (floating point) number. Could anyone explain me the math behind the computation? Here's the snippet: ---8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--
2
3334
by: foleyflint | last post by:
Hello, I'm trying to calculate the interest from a bankaccount which is displayed in a text file as followed: 9 2 345 3 3 300 etc. (there are 19 lines in total) the first number of each line means a day, the second stands for the month and the last for the amount of money on the account. so the first line is Februari 9th with an amount of 345. I want to make the program read the textfile with a Scanner. Then it should...
1
2365
by: Drakscon | last post by:
Im trying to get the compounded interest to go back only being compounded annually. I want the user of this program to be able to do semi annually of monthly or some other. This is my code. Any input is welcome int main() { double a,b,c,d,e;//a is amount to be invested, b is years invested //c is compound time, d is interest rate, e is the final ammount
43
4333
by: parallelpython | last post by:
Has anybody tried to run parallel python applications? It appears that if your application is computation-bound using 'thread' or 'threading' modules will not get you any speedup. That is because python interpreter uses GIL(Global Interpreter Lock) for internal bookkeeping. The later allows only one python byte-code instruction to be executed at a time even if you have a multiprocessor computer. To overcome this limitation, I've created...
2
5432
by: mastern200 | last post by:
I need to make a program that calculates Compound Interest (compounded monthly). Thing is, it has to use recursion. I don't know how to implement it in though. This is the code i have so far. #include<iostream> #include<cstdlib> using namespace std; float initialDeposit=0; int depositMonth=0; float interestRate=0;
88
3808
by: santosh | last post by:
Hello all, In K&R2 one exercise asks the reader to compute and print the limits for the basic integer types. This is trivial for unsigned types. But is it possible for signed types without invoking undefined behaviour triggered by overflow? Remember that the constants in limits.h cannot be used.
14
3152
by: Luna Moon | last post by:
Dear all, Can C++/STL/Boost do the vectorized calculation as those in Matlab? For example, in the following code, what I really want to do is to send in a vector of u's. All other parameters such as t, l1, l2, l3, etc. are scalars... But u is a vector.
1
1024
by: ShadowZone | last post by:
When i ported some simple computation program from c++ to c# i've found out that it works much more slower. I expected that because of using generics instead of pointers which are considered "unsafe" in sharp and other minor changes, but ... The goal for now is to make the new program if not faster then old one, at least equal in performance. So the first option i see is using Microsoft Parallel Extensions (Parallel.Do etc.) but maybe "manual"...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10614
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10369
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.