C++ Code:
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
srand(time(0));
//percentages
double out, walk, s, d, t, hr;
out = 58.0;
walk = 9.7;
s = 22.0;
d = 6.1;
t = 2.5;
hr = 1.7;
char choice; //to hold user choice
do{
int atBat = rand()%1000 + 1; //times at bat 1 to 1000 times
//print all counts
cout<<"No. of Outs: "<<(out*atBat)/100<<endl;
cout<<"No. of Walks: "<<(walk*atBat)/100<<endl;
cout<<"No. of Singles: "<<(s*atBat)/100<<endl;
cout<<"No. of Doubles: "<<(d*atBat)/100<<endl;
cout<<"No. of Triples: "<<(t*atBat)/100<<endl;
cout<<"No. of Home Runs: "<<(hr*atBat)/100<<endl;
//calculate batting average
double avg = ((s+d+t+hr)*atBat)/(100*(atBat - (out*atBat)/100));
cout<<"Batting average: "<<avg*100<<endl; //print avg
//get user choice
cout<<endl<<"Do you want to continue? (Y/N): ";
cin>>choice;
}while(choice == 'y'||choice == 'Y');
return 0;
}
OUTPUT:

Using the random dumber library in c++ please help me out with this problem. I am...
I need help with this Java problem, please. Code must be written in Java Create an application that calculates batting statistics for baseball players. Console Welcome to the Batting Average Calculator Enter number of times at bat: 5 0 = out, 1 = single, 2 = double, 3 = triple, 4 = home run Result for at-bat 1: 0 Result for at-bat 2: 1 Result for at-bat 3: 0 Result for at-bat 4: 2 Result for at-bat 5: 3 Batting...
Help me figure this problem out, please. Use a list to store the players Update the program so that it allows you to store the players for the starting lineup. This should include the player’s name, position, at bats, and hits. In addition, the program should calculate the player’s batting average from at bats and hits. Console ================================================================ Baseball Team Manager MENU OPTIONS 1 – Display lineup 2 – Add player 3 – Remove player 4 – Move player 5...
I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME
OUT AND READ THIS. I just have to explain a lot so you understand
how the program should work.
In C programming, write a simple program to
take a text file as input and encrypt/decrypt it by reading the
text bit by bit, and swap the bits if it is specified by the first
line of the text file to do so (will explain below, and please let
me...
Please read case article, "Attention Kmart Shoppers? Into and out
of Bankruptcy" and help me come up with a solution for the case as
well as action steps to implement the solution! Thank you!!
ATTENTION KMART SHOPPERS? Former Kmart CEO, Charles C. Conaway, failed in his 19-month effort to revive the iconic firm, resulting in the largest retailing bankruptcy filing in history on January 22, 2002 (Davies, et al., 2002). On March 11, 2002, bankrupt Kmart named James B. Adamson...
could you please help me with this problem, also I
need a little text so I can understand how you solved the
problem?
import java.io.File; import java.util.Scanner; /** *
This program lists the files in a directory specified by * the
user. The user is asked to type in a directory name. * If the name
entered by the user is not a directory, a * message is printed and
the program ends. */ public class DirectoryList { public static...