Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Attendance Write a Java program to store attendance of a month. There are 4 weeks in a month and each week has 5 working days.

image text in transcribed

Attendance Write a Java program to store attendance of a month. There are 4 weeks in a month and each week has 5 working days. Declare a two dimensional array attendance. Populate array randomly between 40 to 50. Print attendance in tabular form. Print average of each week separately Matrix Multiplication Write MatrixMultiplication class to perform a simple matrix multiplication. For matrix multiplication to happen the column of the first matrix A should be equal to the row of the second matrix B. Hint: This link is erplain the matrir multiplication https://www.mathsisfun.com/ algebra/ matris-multiplying. html Sample Output Enter matrix A 1 2 3 4 5 6 Enter matrix B 7 8 9 10 11 12 Product of A and B is 58 64 139 154 Block world In this task you are implementing a class BlockWorld in package com.labs. lab4 that simulates a block- world. The blockworld is an n x n grid two-dimensional grid whose cells can either be colored black or white. n is a parameter that can be set when a blockworld is created. Initially, when a block world is created all cells are black. The BlockWorld class should have two constructors. One that takes parameter n and a second one that takes no parameters and creates a grid with n=10. The block world should provide methods for changing the color at a certain position and to get the color at a certain position which have the following signatures. Assume that the color of a cell is represented as a boolean value where true means white and false means black. public boolean get Cell Color (int x, int y): public void setCellColor (int x, int y, boolean setWhite) The class should override the toString method to return the current state of the grid where each row of the grid should be printed on a separate line while each cell would be encoded as a single character: ."" (a space) if the cell is white "X" (an X) if the cell is black For example, a 3 x 3 grid where only the top-left and the bottom-right cells are white should be represented as: XX XXX Test your block world by adding a main method which creates the above example 3-by-3 grid and prints the state: BlockWorld n = new BlockWorld (3); n.setCellColor(0,0, true); // set top-left cell n.setCellColor (2,2, true); // set bottom-right cell System.out.println(n.toString()

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

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago