Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mini Exercise 1: Create a Java class named MiniExercise 1 (1 mark deduction if not). It is to have a main method that calls each

image text in transcribed
image text in transcribed
Mini Exercise 1: Create a Java class named MiniExercise 1 (1 mark deduction if not). It is to have a main method that calls each of the static methods below ( 2 marks deducted if not) Task 1: 12 marks Create a static method named Task1 1) Ask the user how many elements they would like to create. (1 mark) 2) Create an Object array with X elements, where X represents the value in Step 1) (2 marks) 3) In a loop, ask the user to enter a value for each element of the array: (1 mark) a) If the value is either 0 or 1 i) Convert the value to a Boolean (2 marks) b) If the value is within the byte range i) Convert the value to a byte (2 marks) c) If the value is within the short range i) Convert the value to a short (2 marks) d) If the value is a number i) Convert the value to an integer (2 marks) No error handling needed. Expect the user to enter a valid numerical value *** Conversions can be done in any way desired **" Task 2:13 marks Create a static method named Task 2 1) In a loop, create a multi-dimensional array storing the values of the Multiplication Table from 1 to 10 squared (4 marks) Please note: - The first vertical column represents the first dimension of the 20 array - Indices should be between 0 and 9 for both dimensions 2) Ask the user how many questions they would like to answer (1 mark) 3) In a loop: a) Randomly select two indices from the multi-dimensional array in Step 1) (2 marks) b) Display the two numbers and ask the user to input the answer to the expression. ( 1 mark) Example What is 62? The index 5 was selected at random in the first dimension of the 20 array. The index 1 was selected at random in the second dimension of the 20 array c) Capture the user's answer for the expression (1 mark) i) Display a congrats message if the answer is correct (1 mark) ii) Display the correct answer if answer is incorrect ( 1 mark) 4) Display a summary of how well the user did using string formatting a) You answered \{correct \} out of [number of questions]. That's a percentage of (rounded whole number percentage)\% (2 marks) Marking Please submit all .java source files on Blackboard when you are finished. Name the package however you desire

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

Please answer the following:

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago