Team A won! (21-14) Game ended as a draw. (21-21)

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
icon
Related questions
Question

C++

Write a program that reads data about volleyball matches from standard input and then determines the outcome of the game. If the input word is "A" it means that team A scored a point. If the input word is "B" it means
that team B scored a point. If the input word is "end" it means that the game ended. Calculate the scores and announce the team that won or that the game was a draw. Display the game result in this format:
Team A won! (21-14)
Game ended as a draw. (21-21)
O New
I Full Screen *
maln.cpp O
1 #include <iostream>
2 using namespace std;
4.
* Determines the outcome of a volleyball game.
6.
7
int main() {
8
10
return 0;
}
11
Transcribed Image Text:Write a program that reads data about volleyball matches from standard input and then determines the outcome of the game. If the input word is "A" it means that team A scored a point. If the input word is "B" it means that team B scored a point. If the input word is "end" it means that the game ended. Calculate the scores and announce the team that won or that the game was a draw. Display the game result in this format: Team A won! (21-14) Game ended as a draw. (21-21) O New I Full Screen * maln.cpp O 1 #include <iostream> 2 using namespace std; 4. * Determines the outcome of a volleyball game. 6. 7 int main() { 8 10 return 0; } 11
LO: (Apply) Students will compute a value from multi-dimensional data.
LO: (Apply] Students will find the optimal value in a collection.
A group of farmers are using drones to gather data about how much corn they have grown in their plots. The plots are organized in rows, where each row has the same number of plots. The rows are numbered starting
from row 0, the closest row to the farm house. The plots are also numbered starting from plot 0.
The farmers want to know which row had the highest crop yield (how much corn grew). Write a program to find the row with the highest crop yield. If rows are tied for the highest yield, choose the closest row to the farm
house
These methods will help you access the crop data:
void loadcropData()
int getRowcount()
int getRowLength()
int getcropCount (int row, int plot)
Call loadcropData() only once, at the start of your program.
• Call getRowcount() to get an integer representing the number of rows in the field.
Call getRowLength() to get an integer representing the number
• Call getcropCount (r, p) to get an integer representing the number of bushels of corn in plot p of row r.
plots in each row.
Note: Include crops.cpp in order to access the helper functions.
Note: Refer to corn.data for a sample data file. The first value is the number of rows, the second value is the number of plots, and then the remaining values represent the plot yields in row, then plot order.
Transcribed Image Text:LO: (Apply) Students will compute a value from multi-dimensional data. LO: (Apply] Students will find the optimal value in a collection. A group of farmers are using drones to gather data about how much corn they have grown in their plots. The plots are organized in rows, where each row has the same number of plots. The rows are numbered starting from row 0, the closest row to the farm house. The plots are also numbered starting from plot 0. The farmers want to know which row had the highest crop yield (how much corn grew). Write a program to find the row with the highest crop yield. If rows are tied for the highest yield, choose the closest row to the farm house These methods will help you access the crop data: void loadcropData() int getRowcount() int getRowLength() int getcropCount (int row, int plot) Call loadcropData() only once, at the start of your program. • Call getRowcount() to get an integer representing the number of rows in the field. Call getRowLength() to get an integer representing the number • Call getcropCount (r, p) to get an integer representing the number of bushels of corn in plot p of row r. plots in each row. Note: Include crops.cpp in order to access the helper functions. Note: Refer to corn.data for a sample data file. The first value is the number of rows, the second value is the number of plots, and then the remaining values represent the plot yields in row, then plot order.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
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
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education