C++ :: Create A Program That Will Let User Input Amount In Form?

Jan 4, 2014

Figure this out using [TURBO C]

Create a program that will let the user input an amount in the form (367). The Program should determine the no. of coins for each dominations : 50,25,10,5,1. (using Turbo C)

View 7 Replies


ADVERTISEMENT

C++ :: Create A Program That Will Prompt The User For Input?

Dec 28, 2014

I need to create a program that will prompt the user for an input, then it will save their input to a file and then it will prompt the user to input "Open" and then the file containing their first input, will open up and show their input.

View 19 Replies View Related

C++ :: Create Program That Has User Input 5 Digit Number?

Mar 9, 2013

Im trying to create a program that has the user input a 5 digit number. If it's between 10000 & 99999, it will do one thing..(just saying 'yes' for now. Outside those numbers will prompt the user to input again. However, if the user inputs the exact digits 76087, it should display 'term'.

This current code is displaying 'term' whenever the user inputs the 5 digits.

Code:

#include <iostream>
using namespace std;
int main() {
int pin;
cout << "Welcome to Movie Food
Enter your 5-digit pin code: " ;

[code]....

View 14 Replies View Related

C++ :: Create A Program Which Prompts For User Input Of Current And Birth Date

Sep 27, 2014

I have an assignment in which i must create a program which prompts for user input of current and birth date, which will compare said dates and output if its your birthday or not. I've completed a large portion of it, but cannot figure out how to get the user input of month as an integer such a 2 into February.

#include <iostream>
using namespace std;
class DayOfYear {
public:
void input();

[code]....

View 1 Replies View Related

C/C++ :: Create A Program That Prints A Certain Number Of Asterisks Based On User Input

Apr 12, 2015

I need to create a program that prints a certain number of asterisks based on user input. The user inputs 5 and I want my program to output "*****". How would I do this in C? I've tried printf("%#**", myvariable) but this does not work it only prints "*".

View 1 Replies View Related

C :: Create A Program That Asks User To Input Integer Lengths Of Three Sides Of A Triangle

Sep 6, 2013

C programming: I want to creat a program that asks the user to input the integer lengths of three sides of a triangle, and if so whether the triangle is a right-angled, acute or obtuse one. i am having some doubts about the if, else if statements. I never seem to know how and in what order to use them.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char *argv[]){
int SideA;
int SideB;
int SideC;
}

[code]....

View 14 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 :: Input From User As Char And Output In Hex Form

Sep 9, 2014

I'm trying to write a program that takes input from the user (thats a char) and outputs it to the monitor in hex form.The program is meant to continuously take input from the user then output to the monitor in hex form until an EOF is detected this triggers the program to close.The following code does this except that I get a lower case 'a' at the end of each output.I think the 'a' has to do with the enter key and if that is the case how can i tell the program to ignore this input from the user.

Example: input from user: ABC output to monitor: 41 42 43 a

Code:
#include <stdio.h>
int main(void) {
char myChar;
while(EOF != (myChar = getchar())) {
printf("%x ",myChar);
}
system("pause");
return 0;
}

View 5 Replies View Related

C++ :: Coin Program Not Taking In Amount Of Cents In Input

Mar 1, 2013

I'm currently working on a program to take the user's input as DDDD.CC and then converting it to the least amount of coins using quarters, dimes, nickels, and pennies. I was told to not use any doubles or floats as they would produce errors. And supposed to the use the library function atoi() after I take the input user's amount as a string to convert it into an integer.

So far the string input has worked and it produced the right number of quarters but it leaves off the cents. For example, I put in 352.23 and it gives the right amount of quarters but leaves off the 23 cents.here's my code:

#include <iostream> // Allows the program to perform input and output
#include <stdlib.h> // Atoi
#include <string>
using namespace std ; // Enables a program to use all the names in any Standard C++ header
int main() // Start of program execution {
string line ;

[code]....

View 6 Replies View Related

C++ :: Program That Will Input Amount Of Chairs Sold For Each Style

Sep 10, 2014

Write a program that will input the amount of chairs sold for each style. It will print the total dollar sales of each style as well as the total sales of all chairs in fixed point notation with two decimal places.

The program runs fine I am just have problems with the output. I have tried a few different methods for the fixed point notation, but I am getting results like 324.5 rather than 324.50?

#include <iostream>
using namespace std;
int main() {
//Declares variables for chairs
float americanColonial;
float modern;
float frenchClassical;

[Code]...

View 1 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 Sharp :: Create Instance Of Form Into Non Form Class To Access Button / Label

Nov 23, 2014

I have a non form class. I want to update label/ check status of check box etc.. in non form class ( here resides functions that contains logic). How can i do that ?

View 4 Replies View Related

C :: Create File From User Input

Jun 27, 2013

I want to create three files whose names are same but extensions are different. I have to take the name from user. I tried following code but it didn't worked ...

Code:

printf("Name of the file:"); scanf("%s",name);
printf("Format of Input file:");
scanf("%s",ext);
f1=fopen(name.ext,"r");
f2=fopen(name.dat,"w");
f3=fopen(name.src,"w");
f4=fopen(name.RMH,"w");

View 1 Replies View Related

C# :: How To Access User Control Form One Of The Child Form

Apr 22, 2014

I hav created mdi parent form that contain one user control. I want to access that user control from one of the child form

View 4 Replies View Related

C++ ::  How To Create N Amount Of For Loops Without Writing All Of Them Out

Aug 22, 2014

Say I want to exhaust all the possible combinations of 10 variables to find all the solutions to an equation with 10 variables.

I could write out 10 'for' loops, but it would take a lot of space in the code and of course would take a lot of time. Another reason why I want to know this is because it could possible allow me to change the amount of for loops just by changing a number.

I.e., how can I contract the following code into a simple, short form?

for (a[0]=0;a[0]<=9;a[0]++)
for (a[1]=0;a[1]<=9;a[1]++)
for (a[2]=0;a[2]<=9;a[2]++)
for (a[3]=0;a[3]<=9;a[3]++)
for (a[4]=0;a[4]<=9;a[4]++)
for (a[5]=0;a[5]<=9;a[5]++)
for (a[6]=0;a[6]<=9;a[6]++)
for (a[7]=0;a[7]<=9;a[7]++)
for (a[8]=0;a[8]<=9;a[8]++)
for (a[9]=0;a[9]<=9;a[9]++)
if (...)
cout << ... << endl;

View 9 Replies View Related

C :: Program That Allows A User To List All Create New Items

Dec 30, 2013

i want to create a program that allows a user to list all create new items, list those items, delete an item, modify an item, search for an item how can i do that This is my work so far

Code:

#include <stdio.h>
#include <string.h>
struct listofitems
char itemName [50];
float itemPrice = 0;
}

[code]...

View 1 Replies View Related

C++ :: Program To Create A Dialog Box And Shows It To User

Dec 20, 2014

I want to make a programs which creates a dialog box and shows it to the user. The dialog box should not be pre-loaded, here's an example:

cout << "Button a"
cin >> a
cout << "Button b"
cin >> b
cout << "Button c"
cin >> c

[Code] .....

Each button should be under the other. How can I do this in a C++ project?

View 1 Replies View Related

C++ :: Program To Create Integers As User Requests?

Nov 19, 2013

I know it would be easier to create an int array, but I want the program to create integers as the user requests. For example, if the user enters 4, the program creates 4 integers with the names input. Each integer is better as an individual integer, not an element in an array.I'm not sure if this is a possibility with C++.

View 3 Replies View Related

C++ :: Create A Grading Program That The User Inputs A Name?

Feb 17, 2013

I want to create a grading program that the user inputs a name and then on that value (name) there is a vector of doubles to represent his/her mark and then calculates an average how would I go about doing this?

View 1 Replies View Related

C :: Create Program Which Requires The Input?

Nov 16, 2013

I would like to create a C program which requires the input in this form: number1 operator number2, where number1 and number2 are numbers of type double and operator is one of the characters +,-,*,/.

There is my attempt to write this code:

Code:

#include <stdio.h>
double main() {
char operator;

[Code]....

Now I have to solve these problems: This code above doesn't work and I don't know why.I don't know how to fix the case when some user enters the input in this form:

Code: 1.5896 *5 or
Code: 7 / 5

I mean how the program knows that

Code: 1.5896 *5 is the same as
Code: 1.5896*5

I don't know how to fix the case when the user enters the input in the incorrect form for example

Code: 3

View 4 Replies View Related

C :: Create A Program That Prints A Number Of Dots Specified By User

Oct 8, 2013

I'm trying to create a program that prints a number of dots specified by the user, there 4 options to do any loop type or to exit the menu. i'm having problems making it so that after you enter a value and it displays the specified number of dots it clears the results. Also we have to make it so that if a negative integer is entered it still prints out the appropriate amount of dots ie: user puts -9 it prints 9 dots, i know you use the abs() function but it doesn't seem to be working for me. I'm assuming my problem with the abs function is i'm not using it correctly. Use case 1 as the example for the rest because I'm trying to implement everything on one case at a time

Code:

int main() {
//initialization statements
int Num1 = 0;
char dot = '.';

[code]....

View 7 Replies View Related

C++ :: Bubble Sorting With User Defined Amount Of Elements

Feb 25, 2014

I am writing some code to bubble sort a list of randoms numbers, 10 at the moment. I want to be able to user input the amount of elements that would be sorted. I think i'd have to use vector instead of arrays, but unsure how to do this. Or, how to be able to change the size of the array.

#include <iostream>
using namespace std;
#define SIZE 10

float numbers[SIZE];
int move_n;

[Code] ....

View 1 Replies View Related

C++ :: How To Get Program Recognise User Input

Dec 8, 2013

I need the program to do a calculation after the user inputs 10 numbers . This is what I have tried so far:

int count;
float value, high,low, sum,average;
sum=0;
count=0;

input:
printf("Enter a number (enter negative value to finish program):
");
scanf_s("%f",&value);

[Code] ....

output:
average=sum/count;
if(count==10) {
printf("total values :%d
",count);
printf("The Highest value :%f
Lowest Value: %f
",high,low);
printf("The average of the values is:%f
",average);
}

View 3 Replies View Related

C++ :: Program That Accepts Two Input From User?

Dec 8, 2013

I built a program that accepts two input from the user, using a array inside a loop, it is pass to a function inside a class which will display the two number, the problem is when the user is inputting a number and it is 1 the program continuously as the user to input a number, and when 2 is entered the program ask another number and end, but for example you entered 2 and 3. . . it will then outpu 2 and 4 (so 3 + 1 ) and always the last number is plus one. here is the code.

main.cpp
#include <iostream>
#include "newclass.h"
using namespace std;

[Code].....

View 5 Replies View Related

C++ :: Program That Will Allow A User To Input Their First Name Into A String

Feb 23, 2015

So we have a weekend assignment that is "Write a c++ program that will allow a user to input their first name into a string, and use the switch/case statement to produce the following output. Your Program should prompt the use rwith the numbers and the options for each (school, classification, and mood) allowing them to make a choice"

My issue is with the output. The output at the end is the number that they input and not the name of the case they chose, so if they chose option 1 for school it does not print out "BRCC" at the end for the output it prints a 1.

#include <iostream>
#include <string>
using namespace std;
int main(void) {
string name;
cout << "Please enter your name: ";
cin >> name;

[code].....

View 7 Replies View Related

C++ :: Program That Accept Input For User ID

Oct 28, 2013

I need a program to run that will accept an input for user id. It will take the customer input and capitalize the letters, and return invalid id with the user inputted values. Then if it's valid it will add a counter counting the number of letters and numbers. It will keep track until the user puts in !. It seems when I try to pass values from the array to my toUpper function to capitalize it it doesn't seem to work right.

View 3 Replies View Related







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