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


ADVERTISEMENT

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 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++ :: How To Prompt User To Input Only Letters

May 12, 2014

I am trying to write a program to get user's input but only accepts alphabetic characters, nothing else and I want it to ask the user to enter a valid word until they have finally entered a valid one. I have the following code for it but it does not work properly.

void CheckBound (char word1[], int SIZE1) {
int i;
int w1[SIZE4]= {0};
int found;
for (i=0;i<strlen(word1);i++) {

[Code] .....

View 2 Replies View Related

C++ :: How To Prompt User Input Only Letters (a-z)

Mar 1, 2013

How do I have the user enter only letters?

#include <iostream>
#include <limits>
int getInt() {
int x = 0;
while(!(cin >> x))

[Code] ....

But this function prompts the user to only input integer values. I was thinking if I could maybe try tweaking with this one so that the user could only enter letters..no luck though. So how can I have the user input letters only?

View 3 Replies View Related

C/C++ :: Prompt User To Input File Name To Open

Aug 31, 2014

I'm trying to develop a programme which, amongst other things, prompts the user to enter the filename which is to be opened. This is what my code looks like currently:

char filename[20];
FILE *myfile;

printf("Enter the full file name you would like to open:");
scanf("%s", filename);

[Code] .....

However, this only ever returns File Not Found - the file is stored in the same directory as the program, and I have tried looking up this issue online, to no avail ....

View 2 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 :: Prompt User For Input And Display Character In Every Line

Mar 17, 2013

I am having problems printing "->" on the beginning of each line, im trying to do it as a loop and ending it when the user types "q". also i would like to know how to ignore text from the user when the input begings with a specific character. heres what ive done so far, and not currrently working as expected.

Code:
#include <stdio.h>
int main (void) {
char prompt;
printf("~~~ FRACTION CALCULATOR ~~~

[Code] ....

View 1 Replies View Related

C/C++ :: UDF To Prompt / Read And Validate User Input And Return A Value?

Aug 5, 2014

I'm having a problem with the two while statements in my UDF.

- 1. It will run both while loops twice...?

- 2. It now goes into a continuous loop.

- 3. When it did work, it would only return 1 value to the main()...?

#include <iostream> // for use of "cin" & "cout", endl...
#include <iomanip> // for formatting setw function
#include <cmath> // for the general math computations
#include <string> // for creating descriptive strings
#include <sstream> // used to convert a string to an integer
//user defined function
int userValue (int);

[code].....

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++ :: Prompt User For Two Characters - Output Movies That Begin With Input

Nov 24, 2014

I have trouble printing out the movies starting with inputing only two letters.

#include <iostream> //cout, cin, endl,getline
#include <fstream> //ifstream
#include <cstdlib> // exit
using namespace std;

const int NUM_MOVIES = 116792;
struct Movie {

[Code] ....

View 1 Replies View Related

C++ :: List Of Objects - Read Information From Each Object To Compare To User Input Prompt

Apr 19, 2013

I have a list of objects that I need to read information from each object to compare to a user input prompt.

#include "Passenger.h"
#include "Reservation.h"
#include "Aircraft.h"
#include <iostream>
#include <fstream>
#include <string>
#include <list>
using namespace std;
//Function Prototypes
void flightRoster(list<Reservation>&);

[Code] ....

View 1 Replies View Related

C++ :: Recursive Function - Prompt User To Input Base And Exponent Then Generate Final Answer

Oct 31, 2014

I am studying about recursion by myself and i want to make a recursive function that prompts the user to input the base and exponent and generate the final answer .

#include<iostream>
using namespace std;
int recursive(int x, int y);
int main() {
/*int total=1;
int y, x;

[Code] .....

View 4 Replies View Related

C++ :: Program That Asks User To Prompt Integer Number

Nov 18, 2013

Write a program that asks the user to prompt an Integer number and then test whether it is Palindrome Numbers or not.

The following are Palindrome numbers:
1.22
2.333
3.67876
4.44444
5.123454321

View 8 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 :: 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++ :: Best Way To Prompt User Again After Some Conditions Have Met

Mar 9, 2013

Here is a simple drinks machine programm. It basically consists in the user selecting a drink that it's presented, if the user selects correctly the number representing a certain drink, the machine shows the user what was the drink he selected, after his choise the machine asks for money insertion, if the user inserts the incorrect amount of money, the machine shows an error saying that user need to insert the correct amount of money.

My problem is that, if the user selects a different number other than those presentend, the machine displays an error saying that he needs to choose a valid drink, but i can't find a way to reprompt the user again after the error has been displayed. here's the code.

// ***Drinkins Machine*** by Roxmate
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
// initializes the variables coca, fanta, iced and drink to be used in switch function,so that the user can choose what drink he wants.
int coca = 1;

[code]....

View 5 Replies View Related

C++ :: Prompt User For All Elements Of 3x3 Matrix

Dec 3, 2014

prompts a User for all elements of a 3x3 matrix. Your program should then print the matrix as well as the transpose of the matrix

View 1 Replies View Related

C++ :: Write A Password Prompt That Gives A User Only Certain Attempts

Mar 6, 2015

I'm trying to write this c++ programe:

Write a password prompt that gives a user only a certain number of password entry attempts, so that the user cannot easily write a password cracker.

Using FOR Loop. I know this can be easily done using while loop. But I want to know how to do it with for loop aswell.

Here is what I have so far:

Code:
#include <iostream>
#include <string>
using namespace std;
int main ()

[Code] ....

I don't see where the problem is.. The program just executes and does nothing.

View 9 Replies View Related

C :: Re-prompt User With Switch Statement Menu?

Sep 20, 2013

how to re-prompt a user with a switch statement menu that I prompted them earlier with. There are 4 options and after the user chooses an option the menu is supposed to pop up again unless the user chooses option 4, how do I do this? For reference I'll put up my source code.

Code:
int main(){
int init_bal,choice,balance,investment, donation;
printf("Welcome!

[Code]....

View 2 Replies View Related







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