Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java Programming: Write the unit test and the code for the following problems Ch

ID: 3756485 • Letter: J

Question

Java Programming: Write the unit test and the code for the following problems
Check it into your github and provide the link for the solution.

1.Given you have temperature data from two sensors, calculate the average temperature for each one second duration across both sensors.

Constraints

Data from both sensors would not be sent at the same time.

The duration of the average should be configurable.

Assume input is in this format (Comma Separated Values)

Sensor Id,Timestamp in milliseconds from Epoch, Temperature

Example:

Input Data

1,10000,40

1,10002,45

1,11015,50

2,10005,42

2,11051,45

2,12064,42

2,13161,42

Output Data (if configuration is 1 second)

10000-10999: 42.33

11000-11999: 47.5

12000-12999: 42

13000-13999: 42

2. Seating Arrangement. You have n students and n chairs in an exam hall. n/3 students are writing Maths, n/3 are writing physics and n/3 are writing chemistry. The n chairs are arranged in two rows, with n/2 in each row. Write an algorithm to make sure no two maths students sit either next/in front/behind of another maths students.

Explanation / Answer

Solution:

Note: The second question is done as per Chegg guidelines, please repost others.

2)

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote