subject

Eight queens are to be placed on an 8 x 8 chessboard in such a way that one queen is to be in each row. a program will store an array x[] with capacity 8 to represent such a configuration. if x[r] has value c then in row r there is a queen in column c. write a program that asks a user to enter the columns that contain queens in the 8 rows. the program makes sure there are no queens in the same column. the program then prints the board. for example, if the user enters: 0,3,4,0,0,7,6,7 the program should print: no good. (hint: use nested for loop, if column c == array[r] print ‘q’, otherwise print ‘.’) for example, if the user enters: 1,3,4,5,2,8,6,7 the program should print: .. . ..

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
You need a reliable network for about twenty-five computers that will be distributed across a large building. it is important that the network be relatively cheap. which topology should you use?
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Arah has entered data about football players from team a and team b in a worksheet. she enters names of players from team a with details about each player in different columns of the worksheet. similarly, she enters details of all the players from team b. which option will her view the data for team a and team b in two separate sections after printing? a. page break view b. freeze pane view c. split screen view d. full screen view e. zoom out view
Answers: 1
question
Computers and Technology, 24.06.2019 17:50
Which of the following best describe how the depth-limited search works. a normal depth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but values above a specific value will be ignored. a normal depth-first search is performed but values above a specific value will be ignored.
Answers: 1
question
Computers and Technology, 25.06.2019 01:30
What was the advantage of using transistors instead of vacuum tubes in the second-generation computers? a. computers were drastically reduced in size. b. computers no longer produced errors. c. computers became affordable. d. computers could run on electricity.
Answers: 1
You know the right answer?
Eight queens are to be placed on an 8 x 8 chessboard in such a way that one queen is to be in each r...
Questions
question
Mathematics, 12.12.2020 16:10
question
Mathematics, 12.12.2020 16:10
question
Computers and Technology, 12.12.2020 16:10
question
English, 12.12.2020 16:10
question
Mathematics, 12.12.2020 16:10
question
Mathematics, 12.12.2020 16:10
question
Mathematics, 12.12.2020 16:10
question
Biology, 12.12.2020 16:10
Questions on the website: 13722362