Create an array of doubles to contain 5 values Prompt the user to enter 5 values that will be stored in the array. These values represent hours worked. Each element represents one day of work. Create 3 c-strings: full[40], first[20], last[20] Create a function parse_name(char full[], char first[], char last[]). This function will take a full name such as "Noah Zark" and separate "Noah" into the first c-string, and "Zark" into the last c-string. Create a function void create_timecard(double hours[], char first[], char last[]). This function will create (write to) a file called "timecard.txt". The file will contain the parsed first and last name, the hours, and a total of the hours. See the final file below. First Name: Noah

Answers

Answer 1

Solution :

[tex]$\#$[/tex]include [tex]$<stdio.h>$[/tex]  

[tex]$\#$[/tex]include [tex]$<string.h>$[/tex]    

void parse[tex]$\_$[/tex]name([tex]$char \ full[]$[/tex], char first[tex]$[],$[/tex] char last[tex]$[])$[/tex]

{

// to_get_this_function_working_immediately, _irst

// stub_it_out_as_below._When_you_have_everything_else

// working,_come_back_and_really_parse_full_name

// this always sets first name to "Noah"

int i, j = 0;

for(i = 0; full[i] != ' '; i++)

  first[j++] = full[i];

first[j] = '\0';  

// this always sets last name to "Zark"

j = 0;

strcpy(last, full+i+1);

// replace the above calls with the actual logic to separate

// full into two distinct pieces

}

int main()

{

char full[40], first[20], last[20];

double hours[5];

// ask the user to enter full name

printf("What is your name? ");

gets(full);

// parse the full name into first and last

parse_name(full, first, last);

// load the hours

for(int i = 0; i < 5; i++)

{

   printf("Enter hours for day %d: ", i+1);

   scanf("%lf", &hours[i]);

}

// create the time card

FILE* fp = fopen("timecard.txt", "w");

fprintf(fp, "First Name: %s\n", first);

fprintf(fp, "Last Name: %s\n", last);

double sum = 0.0;

for(int i = 0; i < 5; i++)

{

   fprintf(fp, "Day %i: %.1lf\n", i+1, hours[i]);

   sum += hours[i];

}

fprintf(fp, "Total: %.1f\n", sum);    

printf("Timecard is ready. See timecard.txt\n");

return 0;

}


Related Questions

, ¿hacia dónde crees que va el hombre en su afán permanente de mejorar e innovar? ¿será que mejora nuestra condición humana, o será que nos deshumaniza?

Answers

Responder:

Por favor, consulte la explicación.

Explicación:

La pregunta aquí puede verse desde una perspectiva diferente basada en la noción individual. Desde mi propia perspectiva, el deseo de innovar es algo que debe promoverse por varias razones que incluyen; Evitar el estancamiento, impulsar la economía y el comercio, promover la relajación y reducir el estrés humano, entre otros. Sin embargo, la innovación ha visto realmente un aumento drástico en el nivel de automatización utilizando varias herramientas tecnológicas como la inteligencia artificial, el aprendizaje automático, Internet de las cosas, etc., lo que ha provocado una predicción generalizada de que la demanda de humanos se reducirá. Desde mi propio punto de vista, los humanos crearon y programaron estos sistemas y creo que es hora de que más humanos se vuelvan cada vez más conocedores de la tecnología, ya que este aumento en la capacidad innovadora ha ayudado a multiplicar el número y la velocidad a la que se están resolviendo los problemas. Por tanto, creo que el deseo humano de innovar mejora nuestra condición humana.

__________ type of storage is very popular to store music, video and computer programs.
i am doing my homework plzz fast​

Answers

Answer:

Optical storage devices.

Explanation:

Optical storage device are those devices that read and store data using laser. To store data in optical storage devices low-power laser beams are used. It is a type of storage that stores data in an optical readability medium.

Examples of the optical storage device includes Compact disc (CD) and DVD.

The optical storage device is popular in storing data of music, videos, and computer program. Therefore, the optical storage device is the correct  answer.

1
Select the correct answer from each drop-down menu.
What Is DHTML?
DHTML Is
It allows you to add functionality such as
Reset
Next

Answers

Answer:

DHTML (Dynamic HTML) is a collection of a few different languages

Explanation:

Dynamic HTML is a collection of HTML, DOM, JavaScript, and CSS.

It allows for more customizability than regular HTML. It allows scripts (JavaScript), webpage styling (CSS), manipulation of static objects (DOM), and building of the initial webpage (HTML).

Since the question is incomplete, I'm not really sure what all you need answered - please leave a comment if you would like something else explained. :)

Which component of an email gives the recipient an idea of the email’s purpose and urgency?

A.
signature
B.
salutation
C.
CC and BCC
D.
subject line

Answers

Answer:

subject line

Explanation:

it is a brief description of what the email subject is.

Computer programming 5

Answers

Good luck this is the last one

# 1) Complete the function to return the result of the conversion
def convert_distance(miles):
km = miles * 1.6 # approximately 1.6 km in 1 mile

my_trip_miles = 55

# 2) Convert my_trip_miles to kilometers by calling the function above
my_trip_km = ___

# 3) Fill in the blank to print the result of the conversion
print("The distance in kilometers is " + ___)

# 4) Calculate the round-trip in kilometers by doubling the result,
# and fill in the blank to print the result
print("The round-trip in kilometers is " + ___)

Answers

Answer:

See explanation

Explanation:

Replace the ____ with the expressions in bold and italics

1)          return km

 

return km returns the result of the computation

2)  = convert_distance(my_trip_miles)

convert_distance(my_trip_miles) calls the function and passes my_trip_miles to the function

3)  + str(my_trip_km)

The above statement prints the returned value

4)  +str(my_trip_km * 2)

The above statement prints the returned value multiplied by 2

What are recommended CPUs?

Answers

INTEL:

It does vary depending on your PC use, however, for office work, the i5 8th Gen is a recommended CPU as it can handle the requirements for office use without stress. For Gaming and high-end use, the i9 is a recommended CPU as it can handle games easily without stress.

AMD:

AMD Ryzen 3 3300X is good for office work and can handle office scenarios and the AMD Ryzen 7 3800x is good for gaming and high-end use.

Hope this helps,

Azumayay

A (n) ___ system can help a business alleviate the need for multiple information systems.

Answers

Answer:

Enterprise Resource Planning

Explanation:

ERP

5. In an array-based implementation of the ADT list, the getEntry method locates the entry by a. going directly to the appropriate array element b. searching for the entry starting at the beginning of the array working to the end c. searching for the entry starting at the end of the array working to the beginning d. none of the above

Answers

Expert Answer for this question-

Explanation:

Answer- C

What is output given the user input? >three blind mice System.out.print("Enter info: "); Scanner keyboard = new Scanner(System.in); String info = keyboard.nextLine(); Scanner inputScnr = new Scanner(info); int item1 = inputScnr.nextInt(); String item2 = inputScnr.next(); String item3 = inputScnr.next(); System.out.println(item1 + " " + item2 + " " + item1); A. blind mice3 B. 3 mice C. 3 blind miceD. Error: input mismatch exception

Answers

Answer:

Probably would be D.

In the print statement...

System.out.println(item1 + " " + item2 + " " + item1)

this would mean the pattern of the output is "ABA". There is no answer that matches that pattern.

We would see a number at the start, something in the middle and then the number again at the end. Because this is not an option in our answers, by process of elimination, we can determine that the only answer which must be correct is D.

Somewhere along there is also input mismatch exception apparently.

Computer programming

Answers

Here is the answer for the question

what is secondary memory?

Answers

Answer:

Secondary memory refers to storage devices, such as hard drives and solid state drives. It may also refer to removable storage media, such as USB flash drives, CDs, and DVDs. ... Additionally, secondary memory is non-volatile, meaning it retains its data with or without electrical power.

All operations used to construct algorithms belong to one of three categories: sequential, conditional, or iterative. Below is a list of steps from a variety of algorithms. Determine which category to which each of the steps belong (sequential, conditional, or iterative). If the value of test_grade is between 90 and 100, assign a letter grade of A.
Prompt the user for a number, get number from user
Sequential Repeat steps 3-5 until count = 10
If divisor = 0, print error_message
Complete step 1, complete step 2, complete step 3

Answers

Answer:

Answered

Explanation:

1) Conditional category because it uses an IF statement: If value of test grade is between 90-100 assign A.

2) Sequential category: Prompt user for number and get number from user.

3) Iterative category because it is looping: Repeat steps 3-5 until count equals 10.

4)Conditional category: If divisor equals zero print error.

5) Sequential category.

Consider the following code: x = 9 y = -3 z = 2 print ((x + y) * z) What is output?

Answers

The answer will be 3

steps on how to install a mouse​

Answers

Answer:

Verify that the mouse you're thinking of purchasing is compatible with your laptop model. ...

Plug the mouse's USB cable into the matching port on the side of your laptop.

Restart your computer while the mouse is connected. ...

Move your mouse a few times to confirm that the cursor responds.

1) Plug in your mouse's receiver.

2) Make sure that your mouse has batteries or is charged.

3) Turn on your mouse.

4) Press your mouse's "Connect" button.

5) Move your mouse around to test the connection.


Hope that helps.

Which of the following parameters is optional sample(a,b,c,d=7

Answers

Parameter D is Optional as it is already assigned to an integer value: 7.

The optional Parameter is D as it is said to be assigned  an integer value of 7.

What are optional parameters?

This is known to be a process  that  is made up of optional choices that one do  not need to push or force so as to pass arguments at their set time.

Note that The optional Parameter is D as it is said to be assigned  an integer value of: 7 because it implies that one can use the call method without pushing the arguments.

Learn more about Parameter from

https://brainly.com/question/13151723

#SPJ2

What may make it easy for cybercriminals to commit cybercrimes? Select 2 options.

Cybercrimes are not classified as real crimes, only as virtual crimes.

They operate from countries that do not have strict laws against cybercrime.

They are not physically present when the crime is committed.

The United States has no law enforcement that acts against them.

Law enforcement agencies lack the expertise to investigate them.

Answers

Answer: They operate from countries that do not have strict laws against cybercrime.

They are not physically present when the crime is committed.

Explanation:

edg

Answer:

They operate from countries that do not have strict laws against cybercrime.

They are not physically present when the crime is committed.

Explanation:

3 uses of Microsoft word in hospital

Answers

Explanation:

You can write, edit and save text in the program.

The microprogram counter (MPC) contains the address of the next microcode statement for the Mic1 emulator to execute. The MPC value is either the next sequential microcode instruction in the control store (PROM), or a microcode instruction in the control store pointed to by the ADDR bits in the current executing microinstruction. What part of the current executing microcode instruction determines the value placed in the MPC

Answers

Answer:

MAR bit

Explanation:

The MPC computers area set of software and hardware standards that was developed by the consortium of computer firms which is led by Microsoft. It contains the address of a next microcode for the Mic1 emulator foe execution.

The part of the executing microcode instruction that determines the value which is placed in the MOC is the MAR bit. The MAR is the memory address register in the CPU which stores the memory address or such addresses to which some data will be sent and also stored.

which type of secondary storage has a fast reading access among the secondary storage​

Answers

Answer:

RAM provides much faster accessing speed to data than secondary memory. By loading software programs and required files into primary memory(RAM), computer can process data much more quickly. Secondary Memory is slower in data accessing. Typically primary memory is six times faster than the secondary memory.

What is picture ..............​

Answers

Answer:

In its most general sense, a picture is a visual representation of something, especially in the form of a painting, drawing, photograph, or the like. A picture can also refer to a mental image, among other senses.

discuss the term business information SYSTEMS ​

Answers

Answer:

Business information systems provide information that organizations use to manage themselves efficiently and effectively, typically using computer systems and technology. Primary components of business information systems include hardware, software, data, procedures (design, development, and documentation) and people.

Explanation:

Hope It Help you

What is the full form of 'Rom

Answers

Answer:

Read-only memory

Explanation:

Read-only memory is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device.

You are working for a company that is responsible for determining the winner of a prestigious international event, Men’s Synchronized Swimming. Scoring is done by eleven (11) international judges. They each submit a score in the range from 0 to 100. The highest and lowest scores are not counted. The remaining nine (9) scores are averaged and the median value is also determined. The participating team with the highest average score wins. In case of a tie, the highest median score, among the teams that are tied for first place, determines the winner.
Scoring data is be provided in the form of a text file. The scoring data for each team consists of two lines; the first line contains the team name; the second line contains the eleven (11) scores. You will not know ahead of time how many teams will participant. Your program will:
Prompt the user for the name and location of the scoring data file.
Process the sets of records in the file.
Read and store the team name in a string variable.
Read and store the scores in an array.
Display the team name followed by the complete set of scores on the next line.
Calculate and display to two decimal places the average of the nine qualifying scores, dropping the lowest and highest scores.
Determine and display the median value among the qualifying scores.
Display the count of the number of participating teams.
Display the winning team name and their average score. Indicate if they won by breaking a tie with a higher median score value.
A sample data file has been provided to allow you to test your program before submitting your work. Records in the sample data file look like this:
Sea Turtles
11 34 76 58 32 98 43.5 87 43 23 22
Tiger Sharks
85 55 10 99 35 5 65 75 8 95 22
The Angry Piranhas
30 10 80 0 100 40 60 50 20 90 70
The average score for the Sea Turtles was 46.5. The Angry Piranhas and the Tiger Sharks both had an average score of 50.0. The tiger sharks had a median value of 55.0, making them the winners of the competition.
You will define and use at least one function in your solution. As a suggestion, you should consider calling a function that sorts the array of judge’s score values into ascending order (lowest to highest). The advantage of doing this is that after being sorted, the lowest value is the first entry in your array and the highest value is the last entry in your array.
The average or arithmetic mean is a measure of central tendency. It is a single value that is intended to represent the collection of values. For this problem, you will only use nine of the values to determine the average. You will not include the highest score and the lowest score.
The median is another measure of central tendency. The median is often referred to as the middle value. In a set of values, half the values are less than the median and the other half are greater than the median. In a sorted array of five elements, the median is the third element. There are two values that are less then it and there are two values that are greater than it. In a sorted array of six values, the median is the simple average of the third and fourth values. In some cases, the median is a better representative value than the average.
You are encouraged to read the article entitled "Mixing getline with cin".
To receive full credit for this programming assignment, you must:
Use the correct file name.
Submit a program that executes correctly.
Interact effectively with the user.
Grading Guideline:
Correctly name the file submitted.
Create a comment containing the student’s full name.
Document the program with other meaningful comments.
Prompt the user for a file name and location.
Open, read, and process all the data in the input file.
Store the judge’s scores in an array.
Correctly display the team name and all scores.
Calculate and display the average score correctly.
Calculate and display the median score correctly.
Correctly count and display the number of competing teams.
Correctly determine and display the winning team and score.

Answers

Answer:

my sql

Explanation:

try with mysql

and database build

A disk has 4000 cylinders, each with 8 tracks of 512 blocks. A seek takes 1 msec per cylinder moved. If no attempt is made to put the blocks of a file close to each other, two blocks that are logically consecutive (i.e. follow one another in the file) will require an average seek, which takes 5 msec. If, however, the operating system makes an attempt to cluster related blocks, the mean interblock distance can be reduced to 2 cylinders and the seek time reduced to 100 microsec. How long does it take to read a 100 block file in both cases, if the rotational latency is 10 msec and the transfer time is 20 microsec per block

Answers

Answer:

The answer is below

Explanation:

a)

If the blocks of a file are not put together, that is for nonadjacent block of files to each other, the time (t) taken to read a 100 block file is:

t = (average seek + rotational latency + transfer time) * 100 block

Average seek = 5 msec, rotational latency = 10 msec and transfer time = 20 microsec = 0.02 msec

t = (5 + 10 + 0.02) * 100 = 1502 msec

b)

If the blocks of a file are put together, that is for adjacent block of files to each other, the time (t) taken to read a 100 block file is:

t = (seek time * mean interblock distance + rotational latency + transfer time) * 100 block

seek time = 100 microsec = 0.1 msec, rotational latency = 10 msec and transfer time = 20 microsec = 0.02 msec, mean interblock distance = 2 cylinders

t = (0.1*2 + 10 + 0.02) * 100 = 1022 msec

Draw the Abstract Syntax Trees for the following statements and represent them in text form. i) 1+2+3 ii) 6÷3×4+3

Answers

Answer:

your a legend you can do it just pleave

Explanation:

:)

Is there SUM in Small basic? ​

Answers

Answer:

no

Explanation:

Open excel program then use the (IF) function to fill the column of (Expensive/Cheap) then save your

I need help in this computer homework send me it as excel

Answers

Answer:

(7,6)12>34=Mc²

Explanation:

AB

MA

B

F

с

AAB=BC,AM=MC

BM IAC , EF I BC

Write a program that prompts the user to enter two positive integers less than 1,000,000,000 and the program outputs the sum of all the prime numbers between the two integers. Two prime numbers are called twin primes, if the difference between the two primes is 2 or -2. Have the program output all the twin primes and the number of twin primes between the two integers.

Answers

Answer:

In Python:

low = int(input("Low: "))

high = int(input("High: "))

if low >= 1000000000 or high >=1000000000:

   print("Out of range")

else:

   mylist = []

   for num in range(low,high+1):

       flag = False

       if num > 1:

           for i in range(2, num):

               if (num % i) == 0:

                   flag = True

                   break

       if not flag:

           mylist.append(num)

           print(num, end = " ")

   print()

   print("The twin primes are: ",end="")

   count = 0

   for i in range(1,len(mylist)):

       if mylist[i] - mylist[i-1] == 2:

           print(str(mylist[i])+" & "+str(mylist[i-1]),end=", ")

           count+=1

   print()

   print("There are "+str(count)+" twin primes")

Explanation:

See attachment for complete program where comments were used to explain each line

What will happen if there is no reply to the email confirmation?

A.The account will not be activated
B.The account will be Activated
C.The screen will display the message registration form available
D. The screen will display the message registration form unavailable

Answers

Answer:

A. the account will not be activated

Other Questions
One evening, Naseem hears her parents talking about her older brother. She learns that he has failed a drug test at school and must get substance abuse treatment to avoid being expelled. She decides that she will talk to her brother about getting treatment. Naseem asks you for help preparing for this conversation.Do the following to provide help:Look up at least three different treatment programs in your area. Briefly describe these programs as well as the pros and cons of each. What role can Naseem and her family play in helping her brother avoid substance abuse?im from az btw the circumference of a circle is 6 kilometers. What is the radius? diameter of a circle is 20 miles. What is the circumference? Draw a number line and mark all described points on it.Numbers that are either negative or greater than 5. What is the pOH of a substance when [H+] = 5.4 x 10^-8 M Which sentence order creates the most logical sequence for an introductory paragraph? Sentence A: Counting both professional leagues and casual players, soccer is played by more people than any other sport. An estimated one billion people worldwide watched television coverage of the final game of the 2014 World Cup. Sentence B: Soccer is an exciting and popular sport that deserves more recognition and support in the United States. Sentence C: The whoosh of the ball as it flies into the net. The roar of the crowd as a goal is scored. Is any sport more thrilling than soccer? 1) .A. B, C, 2.)A B. C, B, A 3.)A,B,C 4.)C,A,B what is the other type of crust that exist on our planet? When the frequency of a sound wave is doubled, then: Arrabellia Cunningham is 24 years old and single, lives in an apartment with no dependents. Last year she earned $55,000 as a sales representative for Planning Associates. $3,910 of her wages was withheld for federal income taxes. In addition, she had interest income of $142. She takes the standard deduction. Calculate her taxable income, tax liability and tax refund or tax owed for 2018. I have to find the area of the shaded region in the figure above and answer using an exact and approximate answer SOMEONE HELP ME PLEASEWhat was Social Security created to do? what is 20+(5 X 2/5 )+ 3 what is the difference between need and want? 1. If 4r 10 = 18, what is the value of 2r + 9? EXPERT HELP: Some species can reproduce sexually or asexually. In which two situations is sexual reproduction advantageous?A. When no individuals of the same species are available for matingB. When many individuals of the same species are available formating.C. When the individuals live in a stable environment in which theythrive.D. When the individuals live in an environment that suddenlychanges. Determine which of the four levels of measurement (nominal ordinal, interval ratio) is most appropriate for the data below.Class times measured in minutes HELP PLEASE ASAP WILL MARK BRAINLIEST!!!Suppose you are writing a report on the population of the United States. In the report, you want to show the percentage of each state's population that was between the ages of 18 and 25 in 2010. Which visual aid would most clearly support your purpose?A.MapB.Pie graphC.Line graphD.Lithograph What is the net force on an object with a normal force of 750 N and gravity applying 750 N? A space used in industry or research settings that has a controlled level of contaminants is called a __________. Use the sentence to answer the question.The people in the parade walked down the street all in step with one another.Which precise word would best replace the underlined word?(1 point)ranwanderedroamedmarchedI NEED THIS ANSWERED ASAPPPPPPPPPP PLZ LIKE THIS SECOND Why did the Americans move the military post from Santa Fe to a location outside of the city