Question

A bookstore keeps books on 50 racks with 10 shelves each. Each shelf holds 25 books....

A bookstore keeps books on 50 racks with 10 shelves each. Each shelf holds 25 books. Declare a 3D String array to hold the names of all the books in the store. The array’s three dimensions should represent the racks, shelves, and books in the store.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

/******************************BookStroe.java**********************************/


public class BookStore {

   public static void main(String[] args) {

       String[][][] bookStore = new String[50][10][25];

       bookStore[0][0][0] = "C Programming";
       bookStore[1][1][1] = "Java Programming";
       bookStore[49][9][24] = "Advance Java programming";
       System.out.println("The fist book in first rack, first shelf is : " + bookStore[0][0][0]);
       System.out.println("The second book in second rack, second shelf is: "+bookStore[1][1][1]);
       System.out.println("The last book in last self of last rack is: "+bookStore[49][9][24]);

   }
}

/*********************output***************************/

The fist book in first rack, first shelf is : C Programming
The second book in second rack, second shelf is: Java Programming
The last book in last self of last rack is: Advance Java programming

Please let me know if you have any doubt or modify the answer, Thanks :)

Add a comment
Know the answer?
Add Answer to:
A bookstore keeps books on 50 racks with 10 shelves each. Each shelf holds 25 books....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Programming 1. Write a function (header and body) that accepts an integer as an argument...

    C++ Programming 1. Write a function (header and body) that accepts an integer as an argument and returns that number squared. 2. Write the code that will fill an integer array named multiples with 10 integers from 5 to 50 that are multiples of five. (This should NOT be in the form of an initialization statement.) 3. Write the code that will display the contents of the integer array named multiples. Recall: the size of the array is 10. 4....

  • Small screws are stored 50 per box, in boxes measuring 3" x shelves. The shelf dimensions...

    Small screws are stored 50 per box, in boxes measuring 3" x shelves. The shelf dimensions are 1' (high), 1' (deep), and shelves. Calculate the required aisle-feet to store 800,000 screws. 14. 3" x 3" and placed on 3' (wide) and each unit has 10 (a) Calculate the number of shelves needed? Calculate the number of Units needed? Calculate the number of required aisle-feet? (b) (c)

  • Problem 6.07 7 of 13 Constants In a certain library the first shelf is 15.0 cm...

    Problem 6.07 7 of 13 Constants In a certain library the first shelf is 15.0 cm off the ground, and the remaining four shelves are each spaced 31.0 cm above the previous one. Part A If the average book has a mass of 1.70 kg with a height of 22.0 cm, and an average shelf holds 25 books (standing vertically), how much work is required to fill all the shelves, assuming the books are al laying flat on the floor...

  • Part I Short Answer (50 points) 1. Write a pseudocode declaration for a String array initialized...

    Part I Short Answer (50 points) 1. Write a pseudocode declaration for a String array initialized with the following strings: “Einstein”, “Newton”, “Copernicus”, and “Kepler”. 2. Assume names in an Integer array with 20 elements. Write a pseudocode algorithm a For Loop that displays each element of the array. 3. Assume the arrays numberArray1 and numberArray2 each have 100 elements. Write a pseudocode algorithm that copies the values in numberArray1 to numberArray2 . 4. Write a pseudocode algorithm for a...

  • You need to program a simple book library system. There are three java classes Book.java   //...

    You need to program a simple book library system. There are three java classes Book.java   // book object class Library.java   //library class A2.java //for testing The Book.java class represents book objects which contain the following fields title: a string which represents the book title. author: a string to hold the book author name year: book publication year isbn: a string of 10 numeric numbers. The book class will have also 3 constructors. -The default no argument constructor - A constructor...

  • Please follow the instructions carefully. Thank you! For the second activity, I outputted the superhero class...

    Please follow the instructions carefully. Thank you! For the second activity, I outputted the superhero class below. SUPERHERO CLASS public class Superhero{   private String alias;   private String superpower;   private int health;   public Superhero(){       alias= "unkown";       superpower= "unknown";       health= 50; //Realized I did not use default constructor while going through instructions of lab   }   public Superhero(String alias1, String superpower1,int health1 ){       alias=alias1;       superpower=superpower1;       if(health1>=0 && health1<=50)           health= health1;       else if(health1<0||health1>50)           health=25;   }   public void setalias(String alias1){       alias=alias1;   }   public void setsuperpower(String...

  • You are to write a banking application in c# that keeps track of bank accounts. It will consist of three classes, Account, Bank and BankTest. The Account class is used to represent a savings account i...

    You are to write a banking application in c# that keeps track of bank accounts. It will consist of three classes, Account, Bank and BankTest. The Account class is used to represent a savings account in a bank. The class must have the following instance variables: a String called accountID                       a String called accountName a two-dimensional integer array called deposits (each row represents deposits made in a week). At this point it should not be given any initial value. Each...

  • Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names,...

    Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names, and read in course names from an input file. Then do the output to show each course name that was read in. See Chapter 8 section on "C-Strings", and the section "Arrays of Strings and C-strings", which gives an example related to this lab. Declare the array for course names as a 2-D char array: char courseNames[10] [ 50]; -each row will be a...

  • C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data...

    C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data about items in a retail store. Your submission should include 5 files, Retailltem.b, Retailltem.cpp, Store, Store.cpp, and Driver.cpp 1. Retailltem class: The class should have three member variables • description (a string, represent the item's name. A name contains space) quantity (an int, represent how many current available) price (a double, item's price) Member Functions Constructor with default argument get Description getQuantity getPrice setDescription...

  • IN C++ Please!! Declare a global integer constant called SIZE and initialize it to 10. •...

    IN C++ Please!! Declare a global integer constant called SIZE and initialize it to 10. • Declare a global enum variable that will support 10 values – each representing an ant colony {A, B, C, D, E, F, G, H, I, J}. • In the main function, o Declare a 2-dimensional array of size the global integer constant, SIZE. The number of rows and columns should be equal to SIZE, which would make this a square matrix. This array will...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT