Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

As a scientist, you are given a .txt file with a large amount of data on experiment trials formatted as shown below. Experiment 01,1,11824,1562,2,6738544,78569214,3,252,698,4,4568,56997,5,21786,98211 Experiment

As a scientist, you are given a .txt file with a large amount of data on experiment trials formatted as shown below.

Experiment 01,1,11824,1562,2,6738544,78569214,3,252,698,4,4568,56997,5,21786,98211

Experiment 02,1,361,788,2,154,106,3,815,253,4,387,644

Experiment 03,1,228,164,2,6527,3389,3,20046,850,4,6387,2251

etc...

The format is: Experiment number,trial attempt,first tested trials of the experiment,second tested trials of the experiment...repeat

You were given the task to create an interface in C++ for other scientists to use to look up and analyze the data. Below is an example of how the interface will function based off of the users input.

Welcome back.

Please enter the experiment you are searching for: Experiment 02

Analyzing Experiment 02 data...

Please enter request for Experiment 02: Failed attempts

Failed first attempts: 1051

Failed second attempts: 700

Please enter request or type "Exit" to close: Exit

Closing Experiment Database...

-How to calculate failed attempts-

Using the data given from Experiment 02 we have....Experiment 02,1,361,788,2,154,106,3,815,253,4,387,644

trial 1: 361 + 788 = 1149. 1149/2 = 574.5 (round up) = 575. If first tested trials of the experiment (361) < second tested trials of the experiment(788) then failed first attempt = 361 and second tested trials of the experiment = 788 - 575 = 213

trial 2: 154+106 = 260. 260/2 = 130+1 (round up) = 131. Since 154 > 106. Failed first attempt = 154-131=23 and Failed second attempt = 106.

trial 3: 815+253=1068. 1068/2 = 535 (round up by +1). Since 815>253. Failed first attempt = 815-535=280 and Failed second attempt = 253..

trial 4: 387+644=1031. 1031/2=516(round up by +1). Since 384<644. Failed first attempt = 387 and Failed second attempt = 644-516=128.

The program will then add and output the total of the failed first and second attempts from the trials. Hence, Failed first attempt = 361+23+280+387=1051 and Failed second attempt = 213+106+253+128=700.

Please note that the .txt will not have a specified number of trials or experiments and will be tested with both large and small files with the same format.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions