ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 08 May 2017 My Price 11.00

knowledge of using arrays

Hello. I am lost on a java assignment that I need to do. I don't know how to start or how to do the methods. Any type of help would be highly appreciated! I have attached two files: 1) the assignment and 2) a file containing information that my code needs

 

Page 1 of 5ITP 109: Introduction to Java ProgrammingAssignment 07:Multiple ChoiceObjectiveDemonstrate knowledge of using arrays.OverviewYou are creating a set of related classes to represent one Multiple Choice Question and a set of ten questions.ProcedureOpen Eclipse or BlueJ and create a new java project calledAssignment07.MultipleChoiceQuestion.javaThis class is meant to represent one question with the array of answers.Instance VariablesHere are instance variables necessary for this class. You should not create any more.private String question;// The question stringprivate String[] answers;// The array of 4 answersprivate int answerIndex;// The index of the correct answer –> 0, 1, 2, or 3ConstructorsProvide 2 ways to constructors: one that takes values for each instance variable, and sets them up accordingly. Thesecond one takes the question, 4 separate Strings for the 4 answers, and the index of the answer and will create thearray in the body of the constructor to contain those 4 answer Strings.STOP. Test that both your constructors work asexpected. This will require you writing additional code, like a main method and a print method so that you can seewhat is stored in the MultipleChoiceQuestion after it is created.Methods•public String getQuestion ()àreturns a String with the question (getter)•public String[] getAnswers ()àreturns an array of Strings holding the answers (getter)•public boolean checkAnswer (int userAnswer)àreturns a boolean if the userAnswer is correct•public String answersToString ()àreturns a String representation of the array, with each newanswer String on its own line•public String toString()àreturns one String containing the questions and answersStop and Test your code.Remember that you should test your code along the way to make sure your methods actually work as they are expectedto.MultipleChoiceQuiz.javaThis class is meant to represent a quiz of 10 multiple-choice questions. Rather than try to enter questions one at a time,we will have a File that has all the questions in it, and you will use some provided code to get the questions from that

What is an array?A. An object that holds lots of stuffB. An object that is happyC. An object that is sadD. An object that has one name but stores a list of data items, with each itemdirectly accessibleDWhat index does an array start with?A. 0B. 1C. aD. -1AHow do you get the length of an arrayA. Call the size methodB. Call the length methodC. Call the isEmpty methodD. Access the public final instance variable lengthDWhat is the capital of California?A. San FranciscoB. San JoseC. Los AngelesD. SacramentoDWhat is the capital of Wisconsin?A. MilwaukeeB. Green BayC. MadisonD. La CrosseCWhat is the capital of Maryland?A. BaltimoreB. BethesdaC. AnnapolisD. Washington DCCWhat is the capital of Illinois?A. PeoriaB. ChicagoC. Des MoinesD. SpringfieldDWhat is the capital of North Carolina?A. RaleighB. DurhamC. CharlotteD. Winston-SalemAWhat is the capital of Michigan?A. DetroitB. LansingC. MuskegonD. Ann ArborBWhat is the capital of Iowa?A. Cedar RapidsB. Des MoinesC. Iowa CityD. Council BluffsB

Attachments:

Answers

(11)
Status NEW Posted 08 May 2017 03:05 AM My Price 11.00

-----------

Not Rated(0)