I am doing a class homework but I am stuck (first computer class I'm taking) and I can't figure out the first part of my "program". I wanted to try it out by myself but the hw is do in 5 hours and I just can't do it by myself so I am asking for help.....
What I need to do is create a program that tells you the price of a fruit when the fruit is chosen.... I think I have the if/then if/else part down but I can't get it to stay open for me to see the price...
dont know what i am doing wrong.
here is what I have so far... any input will be appreciated..
Thank you.
#include <iostream>
#include <string>
using namespace std;
int main()
You are checking if the character the user entered is equal to the variable, which is currently some undefined and unknown value. Also, chars can only hold one value so there is no way for the user to enter a word as their response and the char to store it all.
Since you are including the string header, you should use std::strings instead of chars.