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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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