C++ :: Calculate Fewest Number Of Each Denomination Needed To Pay A Bill Of Amount Total

Mar 5, 2013

Write a C++ program to calculate the fewest number of each denomination needed to pay a bill of amount TOTAL. For example, if the end user enters $97 for TOTAL, program will output that the bills would consist of one $50 bill, two $20 bills, one $5 bill, and two $1 bills. (Assume that the amount is in whole dollars, no cents, and only $100, $50, $20, $10, $5, and $1 denominations are available.) Aid: You may want to use the modulus operator %.

View 1 Replies


ADVERTISEMENT

Visual C++ :: Calculate Fewest Number Of Each Denomination

Mar 4, 2013

Write a C++ program to calculate the fewest number of each denomination needed to pay a bill of amount TOTAL. For example, if the end user enters $97 for TOTAL, program will output that the bills would consist of one $50 bill, two $20 bills, one $5 bill, and two $1 bills. (Assume that the amount is in whole dollars, no cents, and only $100, $50, $20, $10, $5, and $1 denominations are available.) Aid: You may want to use the modulus operator %.

View 5 Replies View Related

C++ :: Word Counter - Calculate Number Of Letters And Give Total Cost

Nov 4, 2013

I am currently working on an assignment.

#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {
char letter;
int count = 0;
double ppl = 0;
double finalCost = ppl * (count - 1);

[Code] ....

I am trying to create a word counter program that asks for the price per letter and then asks for the sentence they are writing. The app should then calculate the number of letters and give the total cost similar to:

You have 40 letters at $3.45 per letter, and your total is $138.00.

Everything compiles fine but when I run it the inputs don't work and it outputs:

You have -1 per letter, and your total cost is $-0.

View 2 Replies View Related

C++ :: Total Amount Of Even Numbers In Array - Expected Primary Expression Before Int

May 30, 2014

Trying to write a function, Even, that will tell you the total amount of even numbers in the array

#include <iostream>
using namespace std;
const int MAX_ROWS = 3;
const int MAX_COLUMNS = 2;

int Even(int A[int length][int width], int length, int width) {

[Code] ....

View 1 Replies View Related

C :: Read Amount Of Order From Standard Input / Compute And Print Total Price After Discount

Apr 13, 2014

A Bookseller makes special discount for multiple orders of a book as follows:

AMOUNT and DISCOUNT as follows.

5-9 5% 10-14 10% 15-19 15% 20+ 20%

Write a C main function to read the amount of order from the standard input and compute and print the total price of the given order after the discount. Assume that unit price of a book is 10.00$

My problem is that.When i start with this

Code:
#include<stdio.h>
#include <stdlib.h>
int main(void)
{
int number;
float TotalPrice;
printf("enter a number:");

[Code] ....

I get 0 if i enter a number between 0 and 4(0 and 4 included). I don't know where I am doing a mistake. I also want to know if i can handle this buy just if statements. or how can i do it by while and for loops ?

View 1 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

C++ :: Painting Company - Calculate Amount Of Paint Required For Every Contract

Dec 15, 2014

You work for a painting company. Your job is to calculate the amount of paint needed for every contract assigned to the company. This time, you need to paint an outside wall. The dimensions of the wall are 5 X 7m. The window is a circle with the radius of 1m. Write a program that would calculate the following:

The amount of paint needed knowing that you need 1 gallon per 10 square meters. The amount of time to complete the job knowing that it takes 1 hour per 10 square meters to prepare the surface, 5 minute per square meter to pant it and 5 minute per square meter to clean up the area.

View 8 Replies View Related

C++ :: Calculate Total No Of Comparison Using Selection Sort?

Sep 15, 2014

how to put comparision condition in order to caculate total number of comparision in selection sort

static void selectsort(int[] data, int n)
{
int i, j;
for (i = 0; i < n; i++)

[Code]....

View 1 Replies View Related

C++ :: While Statement - Calculate Total For Three Stores Payrolls

Mar 26, 2013

I have a program that needs to calculate the total for three stores payrolls.

Inputs would be the three stores payrolls
Output would be the total of all three

I HAVE to use the while statement.

I have also read the articles on the while statement on here and on other sites. I'm having trouble because every site I've seen so far has only been giving examples of numbers(like counting down or repeating a statement so many times).

Code:

#include <iostream>
#include <cmath>
using namespace std;
int main() {
//declare variables
int storePayroll = 0;
int totalPayroll = 0;
int storeNum = 0;

[Code] .....

View 6 Replies View Related

C Sharp :: Calculate The Total Of Pages For All File?

Oct 21, 2012

How can I calculate the total of pages for all file(pdf,word,excel,txt...) types in a directory with c#?

View 2 Replies View Related

C Sharp :: Calculate The Total And Compare All Row In Datagridview?

Dec 3, 2012

I have a window form with datagridview,textbox,button and listbox. In datagridview i have added a column. In first row i have given the value like 7000,

second row 2500,
third row 7000,
fourth row 1000,
fifth 1300,
sixth 9000....n number of row:

if i enter 12000 in textbox1 then it will calculate the total in particular rows in datagridview.And the total should be less than 12000 what we have entered the value in textbox1.

The result will display in listbox..

like first greater value is 9000+2500=11500 ,
second greater value 7000+1000+1300=9500,
other third greater value is 7,000.

So i have given a sample code where i cannot get the solution ..

  double search;
            search = double.Parse(textBox1.Text);
            double sum = 0;
            for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) {
                double se2 = Convert.ToDouble(dataGridView1.Rows[i].Cells[0].Value.ToString());
                if (se2 == search) {

[code]....

View 5 Replies View Related

C++ :: How To Calculate Total Surface Covered - Overlapping Squares

May 24, 2013

How would i calculate a surface that up to 10^5 squares cover. The info you get is xpos,ypos and width for each square.

How would you calculate the total surface covered (if any overlap only one counts).

Cannot use a big array of bools as the memory limit is 512 MiB.

View 2 Replies View Related

C :: How To Calculate Total Sum Of Delay Of Receiving Side Packet

Dec 17, 2014

I want to calculate the total some of delay pf receiving Side Packet . Code is as Follow ..

What is weird that even if i invoke a sleep of 2 sec ,than its show delay always zero. Delay will be in microsec ..Is there any problem with logic or anything else..

Code:

do
{#pragma omp parallel private(nthreads, tid) {
/* Obtain thread number */
tid = omp_get_thread_num();
if (tid == 0) {
nthreads = omp_get_num_threads();

[Code]...

View 2 Replies View Related

C++ :: Repeat A Question Over And Over And Calculate Total When User Wants To Quit

Feb 27, 2014

Write a program which is used to calculate GPA based on the grades from different courses Input by the user. User should be able to enter as many course unless they choose to quit. Once the user has completed entering the data, the program should be able to provide a feedback on the GPA. Where A=4, B=3, C=2, D=1.

View 1 Replies View Related

C/C++ :: Calculate Total Cost Given The Tax Values - Getting C2784 Error

Sep 3, 2014

// Purpose: calculate total cost given the tax values

#include <iostream>
#incluse <string>
using namespace std;
int main() {
double purchasePrice, stateTaxAmt, countyTaxAmt, totalCost;
//Display purchase price

[Code] ....

View 2 Replies View Related

C :: Generate A Program That Will Allow User To Enter Data For A Stock And Calculate Amount Of Stocks

Oct 5, 2013

Okay, so my assignment for my C class is to generate a program that will allow the user to enter data for a stock and calculate the amount of stocks that ended up being positive, negative, and neutral.I tried to do this using one stock, here is my code;

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

Code:

void main()
{
float Neg;
float incst;
float shrs;
float bpps;
float crnt;
float crntcst;
float yrfes;
float pft;
float tpft;
}

[code]....

View 6 Replies View Related

C++ :: Program To Calculate Total Grade For N Classroom Exercises As Percentage

Mar 5, 2013

Write a program that calculates the total grade for N classroom exercises as a percentage. The user to input the value for N followed by each of the N scores and totals. Calculate the overall percentage (sum of the total points earned divided by the total point possible) and output it as a percentage. Sample input and output it as a percentage. Sample input and output is shown below.

How many exercises to input?
score1: 10
total points possible: 10
score2: 7
total points possible: 12
score3: 5
total points possible: 8

Code:
# include <iostream>
using namespace std;
int main () {
double N=0, score, total, totalScore=0, totalGrade=0, GRADE;
cout<<"How many excersices will be scored?/n";

[Code] .....

Error:
1>------ Build started: Project: HOMEWORK5, Configuration: Debug Win32 ------
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>C:UsersWORKHOMEWORK5DebugHOMEWO… : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

View 4 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

C++ :: Tourist Agency - Calculate Total Price For Customers For A Package Of Vacation?

Apr 25, 2013

SYNOPSIS : KBJ tourist agency Sdn. Bhd wants you to write an application program to calculate the total price for their customers for a package of vacation. The following table shows the price for three destinations (transportation and accommodation) offered by the agency:

Destination TransportationAccommodation
Pulau Redang Child RM15.00
Adult RM30.00RM95 per day
Pulau Perhentian Child RM20.00
Adult RM30.00 RM100 per day
Pulau Kapas Child RM10.00
Adult RM20.00 RM120 per day

This agency company will give some discount to a group of customers with is:

a.10% discount will be given for the group that has a least 5 adults.

b.25% discount will be given for the group that has more than 5 persons (adults and children)

c.30% discount will be given for the group that has at least 15 persons.

Your application program has to display the output using this following screen layout:

KBJ TOURIST CUSTOMER INFORMATION

Customer’s name: XXXXXXXXXXXXX
Number of Children:XXXXX
Number of Adult: XXXXX
Transportation: RMXXX.XX
Accommodation: RMXXX.XX
Total price: RMXXXX.XX

This is the code i got so far but it doesn't work..:(

#include <iostream.h>
int main () {
char customerName,code,A,B,C;
int childNum,adultNum;
double rate,discount,totalPrice,a,c;

[Code] .....

View 8 Replies View Related

C# :: Custom Media Player Time Bar - Calculate Total Size And Proportion

Dec 30, 2014

Im just wondering how would i get a formula to calculate the total size and proportion of how far the media player has been played, in proportion with the size of the sizeable form, i need an int for the:

Width of formLength of movieHow long has been played by user

I have this code so far:

//The current position played! - Within the timer.tick event arg!
string splayed = axWindowsMediaPlayer1.Ctlcontrols.currentPosition.ToString().Split('.')[0];
int iplayed = Convert.ToInt32(splayed + 1);
//The total time of the movie/audio.
string stotal = axWindowsMediaPlayer1.Ctlcontrols.currentItem.duration.ToString().Split('.')[0];
int itotal = Convert.ToInt32(splayed);

[Code] ....

I have the "AxWindowsMediaPlayer" reference installed, but i need to know how it would work...

Attached image(s)

View 14 Replies View Related

Visual C++ :: Calculate Total Of Monthly Costs Of Expenses And Show Annual Cost

Oct 5, 2012

The point of this is to calculate the total of the monthly costs of these 6 expenses and then to show the annual cost. However, there's just a couple of things that's giving me problems and it's the calcMonCost in my code. The error says that it is more than one instance of overload function and also that an unresolved external symbol. Everything else is fine. What does this mean?

Code:
#include <iostream>
#include <iomanip>
using namespace std;
void calcMonCost (double, double, double, double, double, double &);
void calcAnnCost (double, double, double, double, double, double &);
void getData(double &lnPymnt, double &insure, double &gas, double &oil, double &tires, double &maint);

[Code] .....

View 1 Replies View Related

C# :: Materials Sold Bill Generation?

Feb 10, 2015

I've attached a pic of the program im trying to make, i'll explain in a few steps what it's supposed to do and what my problem is:

-User types in the amount of each material used.
-User click's the "Add" button, to add the materials to the bill.
-The bill is supposed to be shown like this:
material1 3x 1340
material2 2x 930
material3 7x 240
material4 1 840

Total 3350

-My problem is that i have like 100 different Materials, and how i should make the program only write the Materials used on the bill, instead of writing all the materials Down, even those which havent been used.

-every material has their own double variable, and a another double variable for the total Price of used material.

-right now it Works as shown on the Picture, i can add amount of each material, and calculate the total Price, and clear all the textboxes.

View 12 Replies View Related

C# :: How To Add Number To Previous To Get Total

Feb 7, 2015

decTotalAmountOwed = decAmountOwed + decAmountOwed;

This is what i've tried so far. The numbers are supposed to be added together once placed in listbox.

View 8 Replies View Related

C/C++ :: Counting Specific Amount Of Times A Number Shows Up

Apr 11, 2015

Ok, so I am writing this program with 10 different functions, and one of those functions needs to count how many times 0 appears in a text file. I've done this before, but I am so stumped right now. Should I get the numbers from the 2d array I have, or should I just use the text file here? Here is what I have right now:

int toursMissed(int scores[][COLS]){
int counter;
for(counter=0;counter<=96;counter++){
if(scores==0){
counter++;
return counter;
}
}

View 7 Replies View Related

C++ :: How To Read Input Of Arbitrary Amount Of Numbers Instead Of Specific Amount

Feb 25, 2015

I'm trying to make a program that allows the user to input an arbitrary amount of numbers and finding the largest of all the inputs but I keep having problems with the output.

javascript:tx('
#include <iostream>
using namespace std;
//******************************************
//CLASS COMPARATOR
//******************************************

class comparator {
public:
comparator();

[Code] .....

And regardless of what numbers I enter, I always get the output of 10. Also I got the EOF idea from my textbook so if there is a better way of doing this I'd like to hear it. I don't know any clear ways that looks nice to end the while loop when the user doesn't have any more numbers to enter.

View 3 Replies View Related

C++ :: Printing Total Number Of Even / Odd Integers

Feb 28, 2013

The program requires the user to enter 10 integers then print the total no. of even integer,highest even integer, lowest even integer then total no. of odd integer,highest odd integer, lowest odd integer

I already got the total no. of even integer and total no. of odd integer. But I don't know how will i get the highest even integer, lowest even integer and highest odd integer, lowest odd integer.

View 2 Replies View Related







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