#include <iostream>
using namespace std;
int main() {
int n,CrabCount;
float avg = 0.0;
cout << "How many crab traps were set(1 to 10 only):";
cin>>n;
int a[n];
for(int i = 0;i<n;i++){
int j=i+1;
cout<<"please enter number of crabs trapped in
"<<j<<" :";
cin>>CrabCount;
a[i]=CrabCount;
}
for(int i=0;i<n;i++){
avg=avg+a[i];
//cout<<avg<<endl;
}
cout<<"Avg is : " <<avg/n<<endl;
int count = 0;
for(int j=0;j<n;j++){
if(a[j]>(avg/n)){
count = count+1;
}
}
cout<<"Total Number of pot catching above Avg
is:"<<count;
}
You need to design a program to record data for a fishing boat. You will need...
You are a waterman daily plying the waters of Chesapeake Bay for blue crabs (Callinectes sapidus), the best-tasting crustacean in the world. Crab populations and commercial catch rates are highly variable, but the fishery is under constant pressure from overfishing, habitat destruction, and pollution. These days, you tend to pull crab pots containing an average of 2.4 crabs per pot. Given that you are economically challenged as most commercial fishermen are, and have an expensive boat to pay off, you’re...
In C++ program Fishing Game Simulation For this assignment, you will write a program that simulates a fishing game. In this game, a six-sided die is rolled to determine what the user has caught. Each possible item is worth a certain number of fishing points. The points will not be displayed until the user has finished fishing, and then a message is displayed congratulating the user depending on the number of fishing points gained. Here are some suggestions for the...
Average Rainfall Design a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the number of...
Tasmanian abalone fishing boats, each costing $500,000, trawl the waters of Tasmania for abalone. The total dollar value of abalone caught by the boats collectively varies with number of boats (N) and is Total $ Value (1000’s of $’s) = 1000N − N 2 This gives a marginal collective total value of the catch of Marginal $ Value (1000’s of $’s) = 1000 − 2N All boats are identical, so each boat has the same size and value of catch....
Design a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterte twelve times, onece for each month. Each itertion of the inner loop will ask the user for the inches of rainfall for tht month. After all iterations, the program should display the number of months, the...
Small Basic Programming Question: Average Score- Write a program that uses loop to collect data and calculate the average score over a number of tests for a number of students. The program should: 1. first ask the user to enter the number of students in the range of 1 to 10. 2. then the program asks the user to enter the number of tests (in the range of 1 to 5) 3. Then use a loop to collect the scores...
Small Basic Programming Question: Average score Write a program that uses loops to collect data and calculate the average score over a number of tests for a number of students. The program should : 1. first ask the user to enter the number of students in the range of 1 to 10. 2. then the program asks the user to enter the number of tests (in the range of 1 to 5) 3. Then use a loop to collect the...
I need help with a C++ assignment: Write a program containing the following: 1. Variable Definitions only as (DieRoll, Guess, cnt1, cnt2) followed by this statement: srand((unsigned int)time (NULL)); which will give the random number generator a random starting point. Note: srand and rand require the TIME.H (or iomanip) cnt1 and cnt2 will be used in Chapter 5 drop box as counters for loops. Do NOT create additional variables. Points will be taken off for any additional variable creation. 2....
Write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 500 inclusive. 1.Use a file called randoms.txt as a input file and output file a. If you go to open the file and its not there then ask the user to create the file and then quit 2. Ask the user to specify how many random numbers the file will hold. a.Make sure that the...
C++ for this exercise, you will make a simple Dungeon Crawl game. For an enhanced version, you can add monsters that randomly move around. Program Requirements While the program is an introduction to two-dimensional arrays, it is also a review of functions and input validation. check: Does the program compile and properly run? does all functions have prototypes? Are all functions commented? Is the program itself commented? Are constants used where appropriate? Are the required functions implemented? Is the dungeon...