Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write Junit tests, please. using JUnit 4 Instructions: Please review the requirements given below carefully and complete your work. You should compress all source files

image text in transcribed

write Junit tests, please.

using JUnit 4image text in transcribed

Instructions: Please review the requirements given below carefully and complete your work. You should compress all source files (including main to test your work) into a zip file and submit it through Canvas. The grading scheme is provided on Canvas. You are free to use any looping construct of your choice Make sure that you display appropriate messages that are intuitive and clear Use Java's random number generator method (limit it to integers only) Do NOT write the entire logic of the program inside main(). Create separate methods that perform all the work and then invoke it from main() Write Junit Tests for Exercise 1 and 4 only. Note: Use of Arrays is not allowed! 3. Write a java program to generate 10 random numbers between 1 and 10. As you generate each number, keep appending it to a string with a comma after each number. In the end give the user a count of each random number in the string and remove the random number with the highest frequency from your string. Note: If two or more numbers have the same frequency then just delete the smallest number. For example if number '2' and number '3' both have frequency of 2 then delete the number '2' from the string. Random Numbers = 1,1,2,4,5,6,6,2,1,2 Frequency: 1 -> 2 2 -> 3 3-> 1 5->1 6 -> 2 Deleting the Numbers with Max Frequency.. Random Numbers = 1,1,4,5,6,6,1 Instructions: Please review the requirements given below carefully and complete your work. You should compress all source files (including main to test your work) into a zip file and submit it through Canvas. The grading scheme is provided on Canvas. You are free to use any looping construct of your choice Make sure that you display appropriate messages that are intuitive and clear Use Java's random number generator method (limit it to integers only) Do NOT write the entire logic of the program inside main(). Create separate methods that perform all the work and then invoke it from main() Write Junit Tests for Exercise 1 and 4 only. Note: Use of Arrays is not allowed! 3. Write a java program to generate 10 random numbers between 1 and 10. As you generate each number, keep appending it to a string with a comma after each number. In the end give the user a count of each random number in the string and remove the random number with the highest frequency from your string. Note: If two or more numbers have the same frequency then just delete the smallest number. For example if number '2' and number '3' both have frequency of 2 then delete the number '2' from the string. Random Numbers = 1,1,2,4,5,6,6,2,1,2 Frequency: 1 -> 2 2 -> 3 3-> 1 5->1 6 -> 2 Deleting the Numbers with Max Frequency.. Random Numbers = 1,1,4,5,6,6,1

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

1. What is outsourcing and why would a company choose to outsource?

Answered: 1 week ago