Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
U

User 10747711

@User 10747711
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help creating a Do-While loop
    U User 10747711

    Thank you very much Garth. Yes my text calls for a Do-While loop that runs up to 10 times and asks the user to enter up to 10 scores, which include the slope and rating for the course, and calculates the handicap for each score. Then I'll need to use either parallel arrays or a two-dimensional array in order to store the score, slope and rating for each entry, and variables for the handicap accumulator and number of scores entered.

    C / C++ / MFC help learning

  • Help creating a Do-While loop
    U User 10747711

    I need help starting a do-while loop in my program that runs up to 10 time that asks the user to enter up to 10 scores, which include the slope and rating for the course, and calculates the handicap for each score. Any help is greatly appreciated. Here's what I have so far:

    //This program calculates a golfers handicap.
    #include <iostream>
    #include <string>
    using namespace std;

    int main()
    {

    int score, slope;
    double rating, handicap;
    string name;
    

    cout << "This program calculates a golfer's handicap.\n";

    //Have the user to input their name, score, slope, and handicap.
    cout << "Enter your name: ";
    cin >> name;
    cout << "Hello " << name << endl;
    cout << "Please enter your score: ";
    cin >> score;
    cout << "Please enter the course slope: ";
    cin >> slope;
    cout << "Please enter the course rating: ";
    cin >> rating;

    //Calculate the golfers handicap
    handicap = (score-rating) * 113 / slope ;
    cout << "Your handicap is " << handicap << endl;

    return 0;

    }

    C / C++ / MFC help learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups