In C++
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
In C++

Transcribed Image Text:3.20 LAB: Golf scores
Golf scores record the number of strokes used to get the ball in the hole. The expected number of strokes varies from hole to hole and is
called par (i.e. 3, 4, or 5). Each score's name is based on the actual strokes taken compared to par:
●
●
●
"Eagle": strokes is two less than par
"Birdie": strokes is one less than par
4 3
"Par": strokes equals par
"Bogey": strokes is one more than par
Given two integers that represent par and the number of strokes used, write a program that prints the appropriate score name. Print "Error"
if par is not 3, 4, or 5. Print "None" if the par is valid, but the strokes do not fall in the range of Eagle/Birdie/Par/Bogey.
Ex: If the input is:
the output is:
Birdie
417118.2791720.qx3zqy7

Transcribed Image Text:LAB
ACTIVITY
3.20.1: LAB: Golf scores
1 #include <iostream>
2 using namespace std;
3
4 int main() {
5
6
7
8
9
10
11}
int par;
int strokes;
/* Type your code here */
return 0;
Develop mode
Submit mode
Run program
Enter program input (optional)
If your code requires input values, provide them here.
Program output displayed here
main.cpp
Input (from above)
Run your program as often as you'd like, before submitting for grading. Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
second box.
main.cpp
(Your program)
0/22
Load default template...
Output (shown below)
li
Expert Solution

Step 1
The C++ program is given below:
Step by step
Solved in 3 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education