C :: Know If Letter Is Inputted Twice
Sep 23, 2013
how can my program read if a letter is inputted again it prompts "letter inputted already"? heres my code:
Code:
#include <stdio.h>
#include <string.h>
#include <conio.h>
[Code].....
View 8 Replies
ADVERTISEMENT
Jun 16, 2014
How can I display my inputted values here without overwriting the other earlier inputted values. It should be displayed like this [URL].... but mine shows this [URL].... I've been stucked here for hours in thinking for an algorithm. Everything is working fine except the PDISPLAY part
#include<iostream>
#include<iostream>
#include<string>
#include<cctype>
#include<cstdlib>
#include <iomanip>
#include <windows.h>
#include<conio.h>
[Code]...
View 1 Replies
View Related
Sep 10, 2014
I have been here for almost 3 months looking for answers in my C++ problems.here's some type of code for this.
cout << "Enter value of x: " << endl; //Let's say 5.
cin >> x;
cout << "Enter equation: "; //Let's say x+1
cin >> equation;
Then the program analyzes that this character "x" has an initial value of 5.I already have the parser for the equation functions (+,-,*,/)This is the only thing lacking. Is there some type of function that i missed?
View 6 Replies
View Related
May 10, 2013
Program works perfectly fine. I input in the length, width and height. But i want it to display those values for every individual prism when i output... along with the area and volume which i already have. Since i made a vector i won't let me cout it normally.
#include <iostream>
#include <vector>
using namespace std;
[Code].....
View 2 Replies
View Related
Sep 14, 2014
#include<stdio.h>
#include<conio.h>
#include<string.h>
char str1[20], str2[20]="kent";
main() {
printf("Enter your Username: ");
scanf("%s",str1);
[Code] ....
View 1 Replies
View Related
Oct 5, 2014
I need to allow the user to input an integer of any length and print out the word of each number in the integer. So the user would enter "324562" and then the output would be "three two four five six two". I'm struggling to understand the best way to do it in C. I know I need a loop that goes through the int but I don't know how to do it
View 7 Replies
View Related
Oct 27, 2013
I came up with this code to try to add each number from a zip code inputted by the user but I think I'm adding up the ascii values not the real values the user is inputting. How I can go from ascii to the real digit. This is my code so far
#include <iostream>
#include <iomanip>
#include <string>
#include <conio.h>
using namespace std;
int main() {
int total = 0;
char ch[5];
cout << "Please input your 5 digit zip code: ";
[Code] ....
View 4 Replies
View Related
Jan 4, 2013
I've been working on this program and I have it all pretty much down, but I just need one thing that I can't, for the life of me, think of! I need to find the reciprocal of a number that the user inputted (ex: if user input was 2 output would be 0.5 or if input was .6, out put would be 1.6 repeating). If theres a simple way, I can't think of it.
View 2 Replies
View Related
Jan 2, 2014
I am trying to get this program to accept two inputs Student number and grade and validate them both
However the program skips over the student number
Code attached AssignmentProgram.c
View 1 Replies
View Related
Feb 19, 2013
I've written a program which takes a character string and then prints each character vertically so that for instance the string 123 can be written as
1
2
3
no what i need is for all the numbers from zero to the inputted number to print the numbers digits vertically but each number to be printed horizontally so that for instance an input of 11 prints
1 2 3 4 5 6 7 8 9 1 1
0 1
i've made it so that i can print all numbers up to the inputted number vertically; however, i am stuck with a method for making each number print horizontally as described above.
View 3 Replies
View Related
Oct 4, 2013
/*Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result.(For division, if the denominator is zero, output and appropriate message.) Some sample outputs follow:
3+4=7
13*5=65*/
#include <stdio.h>
int main()
{
[Code].....
View 10 Replies
View Related
Oct 21, 2014
How can i repeat a loop based on the number inputted by the user?
View 4 Replies
View Related
Mar 15, 2013
I need to represent each inputted amount of rainfall into a graph like this.. how would I do this with loops?
View 5 Replies
View Related
Nov 7, 2014
void Pascal(int n){
int i,j;
int a[100], b[100];
a[0]= 1;
[Code] ....
I've been trying to make a function that prints a pascal triangle based on an integer n inputted.
View 3 Replies
View Related
May 9, 2013
The program is supposed to have a method called Hitscore that adds a score between 0 and 1000 inputted by the user to the total score and increases level by one and print the score to the screen and which level they last completed after each entry . Have the user continue inputting scores to the program until the gamer has finished all 10 levels. After 10 levels, use a method you create called PassScore to have the program compare the score to avgscore (5000). If the score is less than avgscore, have the code respond "You are not angry at all. " if it is above avgscore, then have it respond "You seem quite angry, calm down. " and if it is exactly 5000, have it respond "Average, just average. "
//Angrybird.h
#ifndef ANGRYBIRD_H
#define ANGRYBIRD_H
using namespace std;
class Angrybird {
public:
float newscore;
float level;
[Code] .....
View 1 Replies
View Related
Feb 12, 2014
So I'm trying to count the number of lines in a text file that is inputted by the user. Also the code doesn't sum up the last number of the text file (exmp it calculates and print only 14 from 15 numbers). I'm a beginner in c++ programing.
View 3 Replies
View Related
Jan 16, 2015
I seem to be having a logical error but can not find the sources.
#include <iostream>
using namespace std;
int main() {
int student = 0;
int adult = 0;
[Code] ....
View 1 Replies
View Related
Mar 30, 2013
I am trying to create a code that simply counts the number of vowels inputted by the user. Here's where I am.
Code:
#include <iostream>
using namespace std;
bool isVowel(char ch);
int main() {
int count=0;
char character;
int vowelcount=0;
[Code] .....
View 14 Replies
View Related
Jul 31, 2013
Over the last few days, I've been trying to implement a spell checker in c++ that checks if the inputted word is in the dictionary file on my computer. However, as I'm nearing completion of the project, I keep running into more and more errors, some of which I do not understand. My program is complete, albeit, with some minor bad practices (I hard coded a few things just to get the program up and running.For some reason, everything works well until I output spelling suggestions. I type in "mses" (attempting to spell mess) and it returns some strange characters. It does definitely recognize that there are two permutations that match words in the dictionary (however they are both mess due to the algorithm implemented), and I don't understand why? I will work on removing the duplicates after.
// Spell Checker.cpp : Defines the entry point for the console application.//
#include "stdafx.h"
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <iostream>
[Code] .....
View 7 Replies
View Related
Feb 19, 2013
How do i read a specific part of a file? I am trying to create a game that reads the prices of an object inputted by the user from a file. This is the code i have so far
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ifstream infile;
infile.open ("Objects.txt", ifstream::in);
[Code] ....
The file contains this :
Example objects
( ) store items
(item) (purchase value)/(sell value)
Grocery Store Items
Fish 5 7
Vegetables 10 15
Drinks 20 30
Weapon Store Items
Pistol 300 375
Rifle 400 500
Ammunition 20 30
View 4 Replies
View Related
Nov 11, 2014
My assignment is writing Madd Libs game. I still do not understand how to store inputted strings or values to arrays. I need explanation of collecting inputted data to arrays.
#include "stdafx.h"
#include<stdio.h>
//#include<string.h>
int main(void) {
char string[37] = {'