Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Because all users may not have 10 scores and we want to keep the scores they entered for use at a later date, the above program will have to be modified to add a menu that lets the user decide how many scores they will enter, and a process to save the scores to a file.

Set up a menu that will ask the user to enter a score, slope and rating, or to enter 0 for the score when they are done. The program will then need to check for a value of 0 entered by the user to exit the input loop. You will need to increment a counter each time the user does not enter 0 so that you know how many entries they have made.

Prior to the loop you previous created to populate the array, add logic to create a new file with the user's name as the file name.

Within the loop you previously created to populate the array, add logic to save each score to the user's file.

Once the user enters a 0 you will exit the loop, close the file and execute the code as previously designed until you have displayed all of the scores and the average handicap.

Extra Credit:
Add logic to the program to search for an existing file with the user's name. If you find the file, welcome the user back and then add the new scores to the existing file. If you don't find a file with the user's name, welcome them to the program and create a new file.

this is the first program that need to be edited

#include "stdafx.h"

#include

int main()

{

     // Variable Declaration

     int a;

     // Get Input Value

     cout<<" Please enter the Score:";

     cin>>a;

     int counter = 1;

     //Do while Loop Block

     do

     {

         cout<<" Please enter the course Slope "<

         counter++;

     }score (counter <= a);

     // Wait For Output Screen

     getch();

     return 0;

cout << anArray[h - 1];

while (1) ;           /

//(((Score > 144) "The max score is a double par. I'll give you a 144 for this round."

//(((score 55-155)"This is not an acceptable Slope. Please try again."

//(((score 60-80) "This is not an acceptable Rating. Please try again."

//as per the formulae (((Scores - Ratings) * 113) / Slopes)

Set handicap of a golfer = ((Scores- Ratings * 113) / Slopes)

Display "(Scores-Ratings * 113 / Slopes)*

Display

End Module

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M9455575

Have any Question?


Related Questions in C/C++

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As