Questions
Spring 2019 CMSC 140 Programming Project 4: Days Out Project Specifications Input for this project: the...

Spring 2019 CMSC 140 Programming Project 4: Days Out

Project Specifications

Input for this project:

  • the user must enter the number of employees in the company.
  • the user must enter as integers for each employee:
    • the employee number (ID)
    • the number of days that employee missed during the past year.

Input Validation:

  • Do not accept a number less than 1 for the number of employees.
  • Do not accept a negative number for the days any employee missed.
  • Be sure to print appropriate error messages for these items if the input is invalid.

Output: The program should display the following data:

  • Each employee number (ID) and the number of days missed should be written to the report file named "employeeAbsences.txt".
  • The average number of days a company's employees are absenting during the year should be written to the report file named "employeeAbsences.txt".
  • Create a global variable of type ofstream for the output file. Use this variable to open the fileemployeeAbsences.txt in your program to write data to it. A global variable is defined above the main function and its scope is throughout the program.
  • Create the following three functions that will be called by the main function:

         

  1. A function called NumOfEmployees. This function asks the user for the number of employees in the company. This value should be returned as an int. The function accepts no arguments (No parameter/input).
  2. A second function called TotDaysAbsent that accepts an arguments of type int for the number of employees in the company and returns the total of missed days as an int. This function should do the following:
    1. Asks the user to enter the following information for each employee:
  • The employee number (ID) (Assume the employee number is 4 digits or fewer, but don't validate it).
  • The number of days that employee missed during the past year.
    1. Writes each employee number (ID) and the number of days missed to the output file (employeeAbsences.txt). ( Refer to Sample File Output )
  1. A third function called AverageAbsent that calculates the average number of days absent.
    1. The function takes two arguments:
  • the number of employees in the company
  • the total number of days absent for all employees during the year.
    1. This function should return, as a double, the average number of days absent.
    2. This function does not perform screen or file output and does not ask the user for input.

In: Computer Science

JAVA PROGRAMMING Is there a way I can use a method to place a user input...

JAVA PROGRAMMING

Is there a way I can use a method to place a user input variable into an array? Then call the same method to print the array? I'm new to Java programming I'm not sure how to continue. For example:


import java.util.Scanner;

public class PartayScanner {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.println("Enter pokemon 1:");
String pokemon1 = scan.nextLine();

System.out.println("Enter pokemon 2:");
String pokemon2 = scan.nextLine();

System.out.println("Enter pokemon 3:");
String pokemon3 = scan.nextLine();

System.out.println("Enter pokemon 4:");
String pokemon4 = scan.nextLine();

System.out.println("Enter pokemon 5:");
String pokemon5 = scan.nextLine();

System.out.println("Enter pokemon 6:");
String pokemon6 = scan.nextLine();

System.out.println("Here are your pokemon!");
System.out.println(pokemon1);
System.out.println(pokemon2);
System.out.println(pokemon3);
System.out.println(pokemon4);
System.out.println(pokemon5);
System.out.println(pokemon6);


In: Computer Science

The local bakery bakes more than a thousand 1-pound loaves of bread daily, and the weights...

The local bakery bakes more than a thousand 1-pound loaves of bread daily, and the weights of these loaves varies. The mean weight is 1.7 lb. and 3 oz., or 856 grams. Assume the standard deviation of the weights is 25 grams and a sample of 32 loaves is to be randomly selected.

(A) This sample of 32 has a mean value of x, which belongs to a sampling distribution. Find the shape of this sampling distribution.

a) skewed right

b) approximately normal   

c) skewed left

d) chi-square



(b) Find the mean of this sampling distribution. (Give your answer correct to nearest whole number.)
_____ grams

(c) Find the standard error of this sampling distribution. (Give your answer correct to two decimal places.) ______


(d) What is the probability that this sample mean will be between 846 and 866? (Give your answer correct to four decimal places.) _______


(e) What is the probability that the sample mean will have a value less than 847? (Give your answer correct to four decimal places.) _______


(f) What is the probability that the sample mean will be within 4 grams of the mean? (Give your answer correct to four decimal places.) _______

In: Math

why do we need to test hypotheses in health-related or epidemiological research?

why do we need to test hypotheses in health-related or epidemiological research?

In: Biology

1. Mead argued that all individuals have a dual self composed of what he referred to...

1.

Mead argued that all individuals have a dual self composed of what he referred to as the ______________, the impulsive part of us which is based on want rather than need and the ________________, which is the part of our self that has internalized societal values.

a. I; Me
b. Generalized Other; Significant Other
c. Significant Other; Generalized Other
d. Looking Glass Self; I

e. Me; I

2.

African-American would be considered a(n) ________________.

Answers:
a.

Role set

b.

Role

c.

Ascribed Status

d.

Status Set

e.

Achieved Status

3.

Which of the following is NOT an achieved status?

Answers:
a.

Banker

b.

Student

c.

Father

d.

Male

e.

Club President

4

Children in school are taught not to question what the teacher says and to obey them because they are in positions of authority. This is similar to when adults interact with their bosses at work or policemen when they do not question their authority, reflecting one of the _______________ of school.

Answers:
a.

Functions

b.

Manifest Functions

c.

Purposes

d.

Latent Functions

e.

Roles

5

This concept emphasizes that we are never truly done learning our place in the social world, nor who we are in our social world.

Answers:
a.

Manifest Function

b.

Role

c.

Status

d.

Socialization

e.

Cultural Adaptation

6.

Which of the following are statuses:

I. Asian

II. Hip Hop Artist

III. Performing professionally

IV. A brother loving his siblings

Answers:
a.

All are statuses

b.

II, III, and IV

c.

I and II

d.

I, II, and III

e.

I, II and IV

In: Psychology

What is the economic impact of a federal budget deficit? Describe the effect of debt financing...

What is the economic impact of a federal budget deficit? Describe the effect of debt financing accomplished by a sale of bonds to the general public.

In: Economics

Almost every organization have some workplace negative issue, that everyone knows about, but no one is...

Almost every organization have some workplace negative issue, that everyone knows about, but no one is doing anything about it. Why is there a reluctance by the supervisor to deal with the problem? Think of a problem in your current or former job, that was unresolved. Briefly describe it. What were the negative consequences of not dealing with the problem? (300 words minimum)

In: Operations Management

± Percent Ionization In addition to the acid-dissociation constant, Ka, another measure of the strength of...

± Percent Ionization

In addition to the acid-dissociation constant, Ka, another measure of the strength of an acid is percent ionization, determined by the following formula:

Percent ionization=[HA] ionized[HA] initial×100%

Percent ionization increases with increasing Ka. Strong acids, for which Ka is very large, ionize completely (100%). For weak acids, the percent ionization changes with concentration. The more diluted the acid is, the greater percent ionization.

A convenient way to keep track of changing concentrations is through what is often called an I.C.E table, where I stands for "Initial Concentration," C stands for "Change," and E stands for "Equilibrium Concentration." To create such a table, write the reaction across the top, creating the columns, and write the rows I.C.E on the left-hand side.

Initial (M)Change (M)Equilibrium (M)A+ B→AB

A certain weak acid, HA, has a Ka value of 8.5×10−7.

Part A

Calculate the percent ionization of HA in a 0.10 M solution.

Express your answer to two significant figures and include the appropriate units.

SubmitHintsMy AnswersGive UpReview Part

Part B

Calculate the percent ionization of HA in a 0.010 M solution.

Express your answer to two significant figures, and include the appropriate units.

SubmitHintsMy AnswersGive UpReview Part

Provi

In: Chemistry

In this forum, provide one example of a bi-racial person ... child / adult (in the...

In this forum, provide one example of a bi-racial person ... child / adult (in the media / sports / entertainment / etc) and provide a little bit of their historical background. Dig a little deeper & explore ways they managed or coped with race/ethnic issues in their childhood. Are there any cultural or racial connections to mental health issues? 150 words

In: Psychology

When organizations decide to finance assets, the key is to match meaning current assets with current...

When organizations decide to finance assets, the key is to match meaning current assets with current financing and long term assets with long term financing.

What would be an example of this occurring in business today and what would be the disadvantage from not matching?

In: Finance

In the case of the Death with Dignity Act, If you were tasked with drafting the...

In the case of the Death with Dignity Act,

If you were tasked with drafting the forms and creating policies at the hospital as a director in administration, how would you deal with this today?

What kinds of policies would you create for the hospital?

What kinds of forms would the patients receive and when would they receive them?

What experts/professionals would you consult to help you create the policies and procedures?

In: Operations Management

Q3. [15 marks] A solid steel shaft (E = 210 GPa, ? = 0.33) of radius...

Q3. [15 marks] A solid steel shaft (E = 210 GPa, ? = 0.33) of radius 20 mm has been forced into an aluminium gear (E = 70 GPa, ? = 0.33) of outer radius 40 mm and thickness of 10 mm. There is a radial interference of ? = 0.02 mm. a) Determine the contact (interface) pressure, pc ; [6 marks] b) Sketch the radial stress distribution in the shaft and the gear; [5 marks] c) If the coefficient of friction between the shaft and gear is μ = 0.1, what axial force would be required to move the gear along the shaft? [2 marks] d) What is the maximum torque, which can be transmitted through the shaft? [2 marks] If you cannot solve a) and b) for c) and d) assume pc = 100 MPa.

In: Mechanical Engineering

Imagine that you are the representative of a Chinese food company, and you're hoping to procure...

Imagine that you are the representative of a Chinese food company, and you're hoping to procure a new ingredient for several of your products from a German company. A representative from the German company is flying in to meet with you.

How will you prepare for the meeting to overcome the potential cultural barriers in negotiation?

In: Operations Management

Explain how Artificial Intelligence could be adopted in the lecture hall for IT101 to enable students...

Explain how Artificial Intelligence could be adopted in the lecture hall for IT101 to enable students have total concentration on the lecture and not to be distracted by anything else (such as putting down notes while the lecture is ongoing, etc.). Discuss, in detail, the components of such system(s) and how each component of such system(s) functions

In: Computer Science

In Java, how can I convert a string user input for example a student starts a...

In Java, how can I convert a string user input for example a student starts a uni degree in "Winter/2022", to a date type, and then once I have done that, add 3 years to that value, and changing the season, so for example Student Started: Winter/2022 and Student Finished: Summer/2025. Is there any possible way to do this?

Thank you.

In: Computer Science