Answer:
Please check the attachment.
Explanation:
avg turnaround time = (38+7+42+33+18)/5= 27.6
avg waiting timee = (33+5+28+23+17)/5= 21.2
And its D, A C in Gantt chart at last and exit time are 33, 38 and 42 mentioned as last three in Gantt chart.
Answer:
See explaination
Explanation:
#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// Fill in the code to define payfile as an input file
ifstream payfile;
float gross;
float net;
float hours;
float payRate;
float stateTax;
float fedTax;
cout << fixed << setprecision(2) << showpoint;
// Fill in the code to open payfile and attach it to the physical file
// named payroll.dat
payfile.open("payroll.dat");
// Fill in code to write a conditional statement to check if payfile
// does not exist.
if(!payfile)
{
cout << "Error opening file. \n";
cout << "It may not exist where indicated" << endl;
return 1;
}
ofstream outfile("pay.out");
cout << "Payrate Hours Gross Pay Net Pay"
<< endl << endl;
outfile << "Payrate Hours Gross Pay Net Pay"
<< endl << endl;
// Fill in code to prime the read for the payfile file.
payfile >> hours;
// Fill in code to write a loop condition to run while payfile has more
// data to process.
while(!payfile.eof())
{
payfile >> payRate >> stateTax >> fedTax;
gross = payRate * hours;
net = gross - (gross * stateTax) - (gross * fedTax);
cout << payRate << setw(15) << hours << setw(12) << gross
<< setw(12) << net << endl;
outfile << payRate << setw(15) << hours << setw(12) << gross
<< setw(12) << net << endl;
payfile >> hours ;// Fill in the code to finish this with the appropriate
// variable to be input
}
payfile.close();
outfile.close();
return 0;
}
Answer:
import java.util.Scanner;
public class num6 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter number of guest");
int totalGuest = in.nextInt();
System.out.println("Enter number of slices per guest");
int slicesPerGuest = in.nextInt();
System.out.println("How many Slices are on a pizza");
int slicesPerPizza = in.nextInt(); // Assume each pizza has 5 slices
double pizzasNeeded;
//Calculating the pizza Needed
int totalslicesNeeded = totalGuest * slicesPerGuest;
pizzasNeeded = totalslicesNeeded/slicesPerPizza;
System.out.println(pizzasNeeded);
}
}
Explanation:
In this program User is required to enter values for the variables totalGuest, slicesPerGuest and slicesPerPizza
First calculate the totalSlices needed by totalGuest * slicesPerGuest;
The calculate number of pizzas needed by totalslicesNeeded/slicesPerPizza;