Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please can you tell me how may I define displayquestionsRemaining function on. line 51 and 66 and also how to get size on line 70.

image text in transcribed

image text in transcribed

please can you tell me how may I define displayquestionsRemaining function on. line 51 and 66 and also how to get size on line 70. I am making an app so I need to display remaining questions?

Declare the method and have it modify the questionsRemainingTextView object. Hint Use questionsRemainingTextView.setText() to change the text displayed by your TextView. You may pass a string object into this method as well, e.g. myTextView.setText("Oh, hello there!")s. If you're stuck on which TextView to modify, our provided layout file (section 1 , activity_main.xml) gives this TextView an ID of tv_main_questions_remaining_count and a default value of "99". 3-D. Use display QuestionsRemaining0 This method is now fully-functional, uncomment and call it where necessary (TODO 3-D.1 and TODO 3-D.ii). void displayQuestionsRemaining() \{ questionsRemainingTextView. setText("questions remaining") \} 1 usage \[ \text { int tv_main_questions_remaining_count }=99 \text {; } \] TextView displayquestionsRemaining = findViewById(R.id.tv_main_questions_remaining_count); void onAnswerSubmission() \{ Question currentQuestion = getCurrentQuestion(); if (currentQuestion.isCorrect()) \{ totalCorrect = totalCorrect +1; questions.remove(currentQuestion); displayquestionsRemaining(); \{ int pos = tv_main_questions_remaining_count; \} displayquestionsRemaining(questions. size ()); if (questions.size() ==0 ) \{ String game0verMessage = getGameOverMessage(totalcorrect, totalquestions); System.out.println(game0verMessage); \} else \{ choosenewQuestion(); \}

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

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago