-4
#include <iostream>
#include <string>

 using namespace std;

 int main() {
     int passes; //The number of passed classes 
     int fails; // The number of failed classes
     double grade; //The current grade to be analyzed 

     //Initialize number of passes and fails 
     passes = 0;
     fails = 0; 

     //Prompt for first grade 
     cout <<?Please enter a numeric grade(> 0) : ? :
         cin >> grade;
     return 0;

 }
Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
Vick7
  • 21
  • 4
  • Please ask a question in the actual question body. And show us *where* you get whatever errors you get. – Some programmer dude Feb 19 '17 at 16:05
  • 1
    What those `?` and `:` are meant to do? – xinaiz Feb 19 '17 at 16:06
  • Are you trying to guess C++ syntax? That won't work. – Baum mit Augen Feb 19 '17 at 16:07
  • Not trying to guess it. Trying to learn C++ Syntax. – Vick7 Feb 19 '17 at 16:08
  • 2
    Then [find a good beginners book to read](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)? – Some programmer dude Feb 19 '17 at 16:09
  • I'm following along an example in Chapter 3 in "Programming Like a Pro for Teens". – Vick7 Feb 19 '17 at 16:14
  • 1
    "Programming Like a Pro for Teens" - I think the title might be a hint that this is possibly not the greatest learning resource ever. –  Feb 19 '17 at 16:21
  • Of course finding a good book to read is an obvious option but not easy to find something that suitable for someone seeking the most remedial style of reading. Thanks for the comment. The best way to learn something to be able to apply it in the most articulate manner is trial & error and asking questions. I'm learning that its not the best. In efforts to try to understand some software language this is one thing I came across through my own individual research. It was free through my school's online book database. Thanks for the feedback – Vick7 Feb 20 '17 at 19:51
  • Programming Like a Pro for Teens seems to suit the idea of searching for remedial reading material on this sort of content. Now I know something I would not have known through going through the experience of actually reading and asking questions on here. Once again, I appreciate the feedback. – Vick7 Feb 20 '17 at 19:52

1 Answers1

0

I'm not 100% sure what you've tried to achieve in the cout line, it looks pretty odd. Anyways, try to wrap the string you wish to print with quotes ("). After the cout, you should supply some parameters to the cout, you have no variable named '?', which is where the argument / string is supposed to be, and that's what the compiler points to when it prints the errors you receive. I'd recommend printing 'std::endl' or '\n' in the end of your printed string so the cin would be in a different line.

This is what is it should look like

#include <iostream>
int main() {
    int passes; //The number of passed classes 
    int fails; // The number of failed classes
    double grade; //The current grade to be analyzed 

    //Initialize number of passes and fails 
    passes = 0;
    fails = 0;

    //Prompt for first grade 
    std::cout << " Please enter a numeric grade(> 0)" << std::endl;
    std::cin >> grade;
    std::cout << "Received grade is " << grade << std::endl;
    return 0;
}
Roy Rashti
  • 196
  • 2
  • 15