1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paul [167]
3 years ago
6

Create an interactive program to use class a LightsOut class to allow a user to play a game. Each step in the game will require

the state of the game to be displayed as ##'s and spaces in a grid, obviously get() will be used. Prompt and read input the row and column as shown below. If (0,0) is entered, exit the program. Use toggle() to update the state of the game.
If no command line parameter is given, use rand() to create the initial pattern. However, if a parameter is provided it should be interpreted as an integer and the lowest bit should determine the top-left (1,1) light. The next lowest bit represents the light to the right (1,2) and so on, wrapping to the next row, and ending in the bottom-right (5,5) with the 25th bit.

If all the lights are "out", instead of printing an empty grid, display the message "Congratulations!" and end the program.
Computers and Technology
1 answer:
expeople1 [14]3 years ago
8 0

Answer:

9+10=21

Explanation:

wyd boy

You might be interested in
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (a
Marina86 [1]

Answer:

I am writing a C++ and JAVA program.    

import java.util.Scanner; //for using input output functions

public class LabProgram { // class name

public static void main(String[] args) {//start of main function body

Scanner input = new Scanner(System.in);

// creates input instance of  Scanner type

     String str;  // declares String type variable str for a string value

     int num;  // declares integer type variable num to hold an integer value

     str = input.next(); //scans and reads input string from user

     num = input.nextInt();  //scans and reads input integer from user

//while loop continues to execute until user enters quit 0

while(str!="quit" && num!=0) {  

/* prints the following message, for example if value of num = 2 and value of str = apples then the following print statement prints Eating 2 apples a day keeps the doctor away. */

System.out.println("\nEating " + num +" " + str + " a day keeps the doctor away.");

//takes string and integer as input again and keep taking input until user //enters quit 0

str = input.next();  

num = input.nextInt(); }   } }

Explanation:

The program is well explained in the comments mentioned with each statement of the program. The program simply prompts user to enter a string and an integer. The while loop keeps executing until user enters quit 0. The program keeps taking input string and integer from user and prints the message System.out.println("\nEating " + num +" " + str + " a day keeps the doctor away.");  The loop breaks when the use enters quit 0. The screenshot of the program along with its output is attached.

3 0
3 years ago
:(.
AnnZ [28]

Answer:

Um what?

Explanation:

Chile anyways so-

7 0
2 years ago
Read 2 more answers
This is a while loop question for Information technology.
aev [14]

Answer: use GitHub

Or stack overflow

Explanation:

6 0
3 years ago
Which step creates a connection between a file and a program in python?
Mandarinka [93]
<span>The step of opening a file creates a connection between a file and a program.Opening an output file usually creates the file on the disk and allows the program to write data to it.Opening an input file allows the program to read data from the file.</span>
5 0
3 years ago
What is Deep learning
vodomira [7]

Answer:

Deep learning is an AI function that mimics the workings of the human brain in processing data for use in detecting objects, recognizing speech, translating languages, and making decisions. Deep learning AI is able to learn without human supervision, drawing from data that is both unstructured and unlabeled.

3 0
3 years ago
Other questions:
  • What are the advantages and disadvantages of malware maintenance?
    12·1 answer
  • You work in the Accounting Department and have been using a network drive to post Excel workbook files to your file server as yo
    9·1 answer
  • Machine-to-machine (M2M) technology enables sensor-embedded products to share reliable real-time data ________.Select one:a. ove
    14·1 answer
  • What is the main feature of chat rooms?
    9·2 answers
  • why is there a need of properly interpreting teacher's/manufacturer's specifications before operating any food processing equipm
    9·1 answer
  • You want the user to enter the length, width, and height from the keyboard. Which cin statement is correctly written?
    10·1 answer
  • A digital designer might do computer animations for video games,<br> OA<br> True<br> OB<br> False
    12·2 answers
  • Write about storage<br>(should be in easy words)​
    8·1 answer
  • What is the easiest way to deploy a C++ program to a user’s computer? a. Copy the source code to the user’s computer and then co
    13·1 answer
  • Really helpful, I want to get together tomorrow ,Later I will follow and make it the best answer
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!