C :: Program To Create Output File Containing Customized Loan Amortization Table
Nov 18, 2013
Write a program to create an output file containing a customized loan amortization table. Your program will prompt the user to enter the amount borrowed (the principal), the annual interest rate, and the number of payments (n). The payment must be rounded to the nearest cent. After the payment has been rounded to the nearest cent, the program will write to the output file n lines showing how the debt is paid off.
Code:
#include <stdio.h>
#include <math.h>
int main (void) {
[Code].....
View 1 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
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
Feb 12, 2015
Write a program that creates and displays a table of temperature conversions. Get the starting temperature from the keyboard in degrees Celsius (do not allow input of a value below absolute zero). Also get an integer value to represent the number of degrees to increment for each of a 20 row table (do not allow the increment value to be less than one. The first column will be a row number starting with one, follow by the Celsius value and then the conversions into Fahrenheit, Kelvin, and Rankine. Be sure that all columns are neatly right aligned for a variety of inputs.
Thats what i wrote so far:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double C,F,K,R,n,a;
cout <<"Enter starting temperature in Celsius: ";
cin >> C;
[Code] ....
Thats what the instructor looking for:
Enter starting temperature in Celsius: -500
ERROR: Temp must be >= -273.15: -273.15
Enter increments in degrees Celsius: 100
# Cels Fahr Kelv Rank
1 -273.15 -459.67 0.00 0.00
2 -173.15 -279.67 100.00 180.00
3 -73.15 -99.67 200.00 360.00
4 26.85 80.33 300.00 540.00
5 126.85 260.33 400.00 720.00
6 226.85 440.33 500.00 900.00
7 326.85 620.33 600.00 1080.00
8 426.85 800.33 700.00 1260.00
9 526.85 980.33 800.00 1440.00
10 626.85 1160.33 900.00 1620.00
11 726.85 1340.33 1000.00 1800.00
12 826.85 1520.33 1100.00 1980.00
13 926.85 1700.33 1200.00 2160.00
14 1026.85 1880.33 1300.00 2340.00
15 1126.85 2060.33 1400.00 2520.00
16 1226.85 2240.33 1500.00 2700.00
17 1326.85 2420.33 1600.00 2880.00
18 1426.85 2600.33 1700.00 3060.00
19 1526.85 2780.33 1800.00 3240.00
20 1626.85 2960.33 1900.00 3420.00
Press any key to continue . . .
My question is to know how to make the sequence from 1 to 20 and whats the best statement for increment...
View 2 Replies
View Related
Jan 25, 2013
If a user enters a string of boolean algebra it will ouput the table.
I have input parsing, cycling through the combinations, and outputing working. However once i parse the input I am not sure what to do with it. I have thought of having it write the parsed input to a new file as a function and then use that function, but that seems bad.
How to dynamically create the function, how to implement it.
BTW This is a console function, if that changes anything.
View 2 Replies
View Related
Jan 26, 2015
I have an assignment where I have to create an image and output it as a .ppm file. It has to have a black background and have some letters in a different color. My professor told me that my .ppm header should have p3 600 300 255 and P6 600 300 255(what this means, think it sets up the width x height which should be 300 x 600).
This is what I have so far:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
struct pixel {
unsigned char red;
[Code] ....
Problem in first for loop and what it should look like inside of the for loop, after that I should be able to figure this out... with the fstream (how to output the results in a .ppm file).
View 1 Replies
View Related
Nov 19, 2013
I am having an issue with my sort function. This is one part of the Hash table program. The main issue is that I am trying to sort the pointer table after all of the values have been entered. The ptr_sort function is not a class function and so I am therefore unable to use the class variables psize and pTable. Is there another way I should be trying this? it is a Vector should I use the sort() function from the vector class in STL?
#include "/home/onyuksel/courses/340/progs/13f/p9/util9.h"
#include "/home/onyuksel/courses/340/progs/13f/p9/hTable.h"
#ifndef H_TABLE1
#define H_TABLE1
void ptr_sort ( );
[Code] ....
View 1 Replies
View Related
Jun 24, 2014
My task is to find a quick method to calculate the cash flow on nearly 500,000 loans. However, this problem cannot be solved with a simple amortization schedule. The loans have a variety of attributes like periodic reset dates, caps, floors and balloon dates. Some are variable, some fixed rate and nearly all of them are aged to some degree (months or years). Let’s ramp it up a bit, after running the amortization schedules, I need to input different sets of prepayment speed assumptions, then run it all again… 20 more times!
I am very familiar with Excel/VBA and have created a code ‘loop’ which works flawlessly. Trouble is that Excel doesn't have the capacity to perform these tasks quickly. A recent test of 10,000 loans took nearly 5 minutes.
For starters, I’d like to know: Is C++ generally used for financial analysis? Where do I start? (Basics: books, training class, etc.)
View 9 Replies
View Related
Oct 1, 2014
How would I output a table in C++? I did it a while ago, but I do not remember how, nor do I have the source for the program I did it in.
View 2 Replies
View Related
Sep 29, 2013
I want to create a proper visible table with boundaries that contains boxes and each box receives a value .I don't know where to start from.i have an idea of using matrix for entering values in each box of table,but how to create lines and boundaries ?
View 1 Replies
View Related
Aug 29, 2014
One of my class assignments is to create a program that receive a .txt file containing a students name and their grades as follows:
John K. 99, 87, 57, 89, 90, 95
Amanda B. Jones 100, 88, 76, 99, 86, 92
etc..
The number of students is unknown until run time. You have to take those grades and average them weighing the first (4) at 10% a piece and the last (2) at 30% each.
Then return an output file with the students name and their letter grade A,B,C,D,F based on their computed score. In addition, on screen it needs to display the average scores for each Q1, Q2, etc. as well as the minimum and maximum for each test on the screen. I am having a hard time in assigning the scores to a variable so that they can then be computed as an average and then used to determine a letter grade. I have begun to write the code and am a bit stuck..here's what I have so far:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
[Code]....
View 2 Replies
View Related
Aug 1, 2012
I would like to create an array of struct variables inside a table to avoid using many if/else and/or switch/case statements. I have attached a simple example of what I am trying to do, it doesn't work. For the table "sTablePtr" I see different values than what I set, when I dereference it with a "&" it just shows me the addresses of the variables. However at the end, when I do print out the values, by just using the structs themselves, they print out the values correctly.
My structure declarations must remain a pointer. To be clear, what I am trying to do is have sTablePtr[i] show me the correct values I set, in this case I want the for loop to print out 1, 2 and 3. If there is a different way of doing this, I am open to it as long as I can use a table of my struct variables to avoid many if statements.
#define MAX_CNT 3
typedef struct {
int nNum;
int nCnt;
}sDummy1;
[Code] ....
View 4 Replies
View Related
Jan 21, 2013
how to create a symbol table for an assembly language and high level language program in c++
View 1 Replies
View Related
Feb 26, 2015
Project Golfer.cpp
So when you enter the number 99 its supposed to quit the program and it wasnt so i fixed that then i noticed that if you don't hit the green its supposed to loop back to a certain point but it was going to far back so i put a goto statement in and now it wont output my data table.
View 1 Replies
View Related
Nov 22, 2014
I have a large hash table, where each index has a container that has a doubly linked list. Things work up until releasing the memory. Each record is created with malloc, and each record->data is also created with malloc and the associated string is copied in using strcpy(). The table itself is released in another part of the program and doesn't produce and error.
/**
* valgrind --track-origins=yes
*/
==16898== Conditional jump or move depends on uninitialised value(s)
==16898== at 0x8049685: shFree (SpellHash.c:110)
==16898== by 0x8049352: unload (dictionary.c:115)
==16898== by 0x8048E64: main (speller.c:158)
==16898== Uninitialised value was created by a heap allocation
[Code] .....
How to interpret valgrind. Error resolved on a small problem. Now running into issues on large (>10000 words to check) problems. It appears the virtual machine just can't keep up for some reason. Running the code on my local computer produces no errors, memory usage is minuscule, and profile tools don't report any issues.
View 4 Replies
View Related
Apr 8, 2015
Have everything working fine as far as input and functions.. I am supposed to output the information as a table. I started to write a void function in order to complete this task. I know how to output the information if i were to have an array for the months, but how to display the months when I am using a switch statement.
#include <iostream>
#include <cstring>
#include <iomanip>
/* author: John Pierce
Description: program reads in averages, then prompts user for current month. The program then
continues to prompt the user for the rain fall amounts for the previous year. */
using namespace std;
void printMonth(int month);
[code].....
View 2 Replies
View Related
Jan 21, 2013
How to create a symbol table for an assembly language and high level language in c++?
View 1 Replies
View Related
Jul 24, 2014
I have this assignment where I have to create a map based hash table for a sparse matrix. The professor has provided some code and I'm supposed to fill in parts of it to make it work.
He has given us a class sparseMatrix which we need to provide a hash function for. This hash function is to be defined in a Class TupleHash which is inside sparseMatrix. I think I got that part down. What is really confusing me is what he has done with some typedefs.
For one of them I had to declare an unorderd_map that maps a struct Tuple on to the class template argument Object. I did that like so:
typedef unordered_map<Object,Tuple,TupleHash> HashTable;
The next typedef was given to me like so:
typedef typename HashTable::value_type valueType;
This is giving me a world of unintelligible error messages. This is how it starts.
In instantiation of 'struct std::__detail::__is_noexcept_hash<int, sparseMatrix<int>::TupleHash>':|
recursively required from 'struct std::__and_<std::is_default_constructible<sparseMatrix<int>::TupleHash>, std::is_copy_assignable<sparseMatrix<int>::TupleHash>, std::__detail::__is_noexcept_hash<int, sparseMatrix<int>::TupleHash> >'|
View 1 Replies
View Related
Jan 14, 2015
So I'm supposed to write something that will output a multiplication table from two user input integers between 2 and 10.
For example it should display like this is the user inputs 4 and 5
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
I was hinted to used two for loops and this is what I have thus far, what I can't figure out is how to display it like the example.
#include <iostream>
using namespace std;
int main() {
int num1;
int num2;
cout << "Enter two numbers between 2 and 10." << endl;
[Code] .....
View 2 Replies
View Related
Jan 26, 2015
I want to create a program that would take an AVI file, alter each frame (ex: change contrast, invert colors, etc.) and dump a new AVI. I've wrote a simple program for this experiment that loads up the header information from the video and dumps it. It also dumps a list of the frame data chunks within the 'movi' chunk.
The info I've gathered from coding this:
1. The recommended buffer size for each type of stream (vids, auds, etc.) is the size of the largest frame of corresponding type, plus 1 or two extra bytes.
2. numFrames in main header is the total number of frames for all types of data (video,audio,etc.) The 'length' value within stream header of type 'vids' is the number of video frames. The sizeImage value within BITMAPINFOHEADER is 921600 (==640*480*3) and the specification states that, quoth, "This can be set to 0 for uncompressed RGB bitmaps."
3. This video uses DIVX encoding.
Now my problem is this: How do I get the data within each video frame in a simple BMP like format? Even the uncompressed frames (with chunk id 'nndb') have variable sizes...let alone the compressed ones.
Information about a software that converts AVIs to a format with fixed sized uncompressed frames. Or at least some information about the frame decompression techniques.
Here's a dump made by the program for a 9 sec, 640x480 video I recorded from Pokemon. (Without the frame dump that is, it'd have made the post too long.)
Code:
AviMainHeader
-------------
size = 56
usecPerFrame = 66666
maxBytesPerSec = 7680000
padSize = 0
flags = 0x00000810
numFrames = 162
initialFrames = 0
numStreams = 2
[Code]...
View 4 Replies
View Related
Oct 8, 2014
How do you make a program output a ppm file?
Code:
#include <stdio.h>
void make_pixel
(
int r, // red intensity
[Code].....
View 7 Replies
View Related
Dec 10, 2014
I am trying to get my program to output the name from a file. The user should enter first name "or" last name. and if the user does not type the name from the input file. the get an error message. How do you do it
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
const int NUM_STUDENTS = 17;
const int NUM_QUIZZES = 10;
const int NUM_EXAMS = 5;
[Code] ....
View 4 Replies
View Related
Feb 21, 2015
My project involves writing a c program to generate a set of 70 decimal numbers. I want to save the output (these 70 numbers) as a txt file. I tried the following:
1. prt scr of output screen and pasting it in notepad. NOT WORKING
2. going to DOS SHELL and doing the following:
c:TCBIN>output.exe>>output.txt
NOT WORKING. Text file is generated, but it does not contain output. It just says:
illegal command: output.exe
What do I do?
View 2 Replies
View Related
Apr 24, 2013
//code
ofstream outFile;
outFile.open("p4a.dat");
outFile << setw(8) << "90.0";
outFile << setw(8) << "75.0";
outFile << setw(8) << "36" << endl;
[Code] .....
View 1 Replies
View Related
Mar 27, 2013
basic code for writing output of a program to a file? I can't seem to find it online and I need it to complete a project.
View 2 Replies
View Related
Nov 8, 2013
So the latest challenge from jumping into c++ is as following.
Code:
Write a function that builds the multiplication table of arbitrary dimensions This chapter also talks a ton about 2d arrays.
So I've built my program thus far as this.
Code:
#include <iostream>
using namespace std;
int drawTable(int,int);
int main()
[Code] .....
So basically, the idea is that I can use the arrays dimensions as a placeholder, and just multiple them to get that specific spot, so table[0][0] = 0, [0][1] = 0 and so on. However the output actually seems to be randomly generated numbers so I'd like to ask, what am I doing wrong? Am I on the right track? Or have I missed the bus stop completely.
View 12 Replies
View Related