How create a loop which gives the player instructions

Assignment Help Computer Engineering
Reference no: EM132151422

Your task is to recreate this game in Java, albeit in a simpler, text-based format. The player enters sequences of three numbers to see if they follow the hidden rule.

When the player has entered their sequence, the program should reply whether or not the sequence followed the rule.

You can use the same rule or create your own. Regardless, the game is played the same way.

How Create a loop which gives the player instructions on what to input. Then read input from the player. The input will be either one of two options:

• If the user enters the word "answer" or some other string you choose to indicate the player is ready to end the game and guess. - In this case, prompt the user to guess our game's rule, then output the answer. - Advanced We can use the .contains() method to analyze the guess and our output accordingly:

* If the guess contains the string "doubled" or "doubling" or "multiple," the guess if most likely wrong.

* If the guess contains the string "increase" or "increasing," the guess is most likely right and you can tailor the output accordingly.

• Three numbers separated by spaces. - If the user enters a sequence that follows the rules, output "Yes!" - Otherwise output "No."he

This is the way my instructor looking for

Thanks

String num;

do{ Scanner secan = new Scanner(System.in);

System.out.println("Please enter sequence number str: "); // it can be "123"

num = secan.nextLine(); // then read it

int reh=Integer.parseInt(num); // then convert it into integer

System.out.println(reh);

for(String retval: num.split("")){ // then split that

System.out.println(retval);

// ono loop and one method go insdie here which is calculate the number increasing order then print

}while(num.contains("answer"));

Reference no: EM132151422

Questions Cloud

Data analysis and quality improvement : To display knowledge of Data Analysis and Quality Improvement materials and be able to apply theory to practice.
The difficulties in identifying the source of a packet sent : Based on your study of the upper layers of the tcp/ip architecture, what are the difficulties in identifying the source of a packet sent over the Internet?
Can you write a better strategy one that is more efficient : The quality of the code will matter as well as the performance. All class methods require a docstring for a general description of the method.
Self-interest in disincentivizing : In light of the news over the past several months, do you think a company/government agency has a clear self-interest in disincentivizing a whistleblower
How create a loop which gives the player instructions : How Create a loop which gives the player instructions on what to input. Then read input from the player.
What are the theoretical and practical issues : What are the theoretical and practical issues raised by the application of international humanitarian law(IHL) to outer space?
Systems analysis and design : Allsports is a multisport club which has several thousand members who take part in a diverse range of sporting activities, such as football, cricket
The functionality to auto-match students to a coach : Allow students to sign up for needing a coach. They also would have a list of courses they need coaching in and a list of available times.
How do you think a team should be chosen and structured : How would you handle meetings and prioritize functionality? What would be the impact of moving some of your team offshore?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write the xhtml for a three-column table

Write the XHTML for a three-column table to describe the courses you are taking this semester.

  Questionprogram use a matrix represents an island

questionprogram use a matrix represents an island surrounded by water. two bridges lead out of island. a mouse is

  Discuss the approach of publishing an article

We are getting close to the residency on June 15-17. This assignment will be shared with your group to generate a discussion for the group project during.

  State the implications and consequences of dealing

Pic k a topic relevant to the information we have covered to date, including this week. It can cover information in Chapters 1,2,3, and 9.

  Write the type definitions necessary

Write the type definitions necessary to contain information in a direct file. How many book records can a computer with 1,440,000 characters of file space hold?

  What protections are in place to ensure atomicity

If your implementation is correct, what protections are in place to ensure atomicity and consistency? Could a more effective method of ensuring data integrity be implemented in your solution?

  Which of the three elementary methods runs fastest

Give a sequence of "compare-exchange" operations for sorting four records. Which of the three elementary methods runs fastest for a file in reverse order?

  Circle any of the given which offer persistent byte storage

question 1 circle any of the following which offer persistent byte storagecpu flash memory hard drive random access

  Write a prolog predicate print state

Write a Prolog predicate print state(X) which will print a state X to the terminal using an asterisk to represent a markable cell and a space to represent a gap between runs of markable cells.

  What is the difference between a sequential control

post a 200 to 300-word response to the following questionwhat is the difference between a sequential control structure

  Define reasons for these recommendations

You have been asked by Champions, a local charity retail organization, to install the network in its downtown office. It currently just received the donation of four PCs running Windows XP Home Edition.

  How to write code for selection sort, insertion sort

How to write code for selection sort, insertion sort. Using your performance of selection, bubble and insertion sort, add a counter in an appropriate place so as to measure the runtime of your code for example this capacity be a counter to track ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd