Questions
using java Define a class Library based on the following specifications: a. A library can have...

using java

Define a class Library based on the following specifications: a. A library can have multiple books. Decide on the best possible data structure to store books. b. A library has a name. c. A library has an address. Define a 2-argument constructor for the Library class. Decide on the arguments needed for this constructor. e. Define a method that can add new books to the library. f. Define a method that allows a book to be borrowed (checked out). Note: a book can be borrowed if and only if it's available. Decide what parameter(s) if any to pass to this method and if this method needs to return a value (if any). 9. Define a method that allows a book to be returned to the library (checked in). Decide what parameter(s) if any to pass to this method and if this method needs to return a value (if any). h. Define a method that allows a library to be searched for a given book based on the book's ISBN. Decide what parameter(s) if any to pass to this method and if this method needs to return a value (if any). 1. Define a method to print the name and address of the library plus the list of books the library has.

In: Computer Science

Explain the differences between primitive and reference data types. Define the scope of a variable (hint:...

  1. Explain the differences between primitive and reference data types.
  2. Define the scope of a variable (hint: local and global variable)
  3. Why is initialization of variables required.
  4. Differentiate between static, instance and local variables.
  5. Differentiate between widening and narrowing casting in java.
  6. the following table shows data type, its size, default value and the range. Filling in the missing values.

TYPE

SIZE (IN BYTES)

DEFAULT

RANGE

boolean

1 bit

true, false

Char

2

‘\0000’ to ‘\ffff’

Byte

0

Short

0

-215 to +215-1

Int

4

Long

0L

-

Float

4

00.0f

Double

8

-1.8E+308 to +1.8E+308

  1. Define package as used in java programming
  2. Explain the importance of using Java packages

In: Computer Science

A person wishes to record audio and save it to memory with an ARM-based CPU architecture....

A person wishes to record audio and save it to memory with an ARM-based CPU architecture. Assuming the audio data is uncompressed, and saved to a hard disk, write a description of what components would be needed to create an audio recorder. Describe how you would perform quantization, and how you would interface the disk controller using a bus mastering scheme.

In: Computer Science

Write, test, and debug (if necessary) JavaScript scripts for the following problem. You must write the...

Write, test, and debug (if necessary) JavaScript scripts for the following problem. You must write the HTML file that references the JavaScript file.

Use prompt to collect names of persons from the user. When the user enters ‘DONE’, your script should stop collecting more names. Then, it should ask the user to specify the following style properties:
- Border size? 2px, 5px, or 8px.
- Border Color? blue, red, green, and black.
- Border style? solid, dotted, dashed, and double.

The HTML document should display the person names in a table using the style properties specified by the user.

*web development course

In: Computer Science

Start by first: Write the code necessary to accept a date in the format (Alice:November,4,2020) and...

Start by first: Write the code necessary to accept a date in the format (Alice:November,4,2020) and store it in a structure called birthday. (Define the structure, declare the variable, ask the user for input, and store the values in the structure. The month should be a character array, the day and year should be integers.)

Then, Declare a pointer name bdayptr to the type of structure you defined in the previous question. Have the pointer point to the structure you declared, and using the pointer, update the name to the Queen and day to the 31.

C++ Coding Please. Comment in code if you can. thank you!

In: Computer Science

1)define variables. 2)define functions. 3)define data structure.

1)define variables.

2)define functions.

3)define data structure.

In: Computer Science

Consider the following relational database schema:             employee(employee-name, employee-id, street, e-city)             works(employee-

Consider the following relational database schema:

            employee(employee-name, employee-id, street, e-city)

            works(employee-id, company-id, salary)

            company(company-name, company-id, c-city)

            manages(employee-id, manager-id)

Specify the following queries on this database schema using the relational operators we discussed in class. Write your answers on a separate sheet of paper in the order that they are specified below.

  1. Retrieve the name and address of employees who work for First Bank Corporation.
  1. Retrieve the name, street address, and city of residence of all employees who work for Thrifty Industries and earn more than $10,000 per year.

  1. Retrieve the name of all employees who live in the same city as the company for which they work.

  1. Retrieve the name of all employees who live on the same street and in the same city as do their managers.

  1. Retrieve the name of all employees who do not work for First Bank Corporation.

  1. Retrieve the name of all employees who earn more than every employee of Small Bank Corporation.

  1. (Assume that companies may be located in several cities) Retrieve all companies located in every city in which Thrifty Industries is located.

  1. For each company, find the average salary of employees working for that company.

  1. For each city, find the number of employees who work for at least one company in that city.

In: Computer Science

MATLAB: Write as a script in the editor window of matlab. Quadratic roots. Write a program,...

MATLAB: Write as a script in the editor window of matlab.

  1. Quadratic roots. Write a program, quadroots.m, for finding the roots of the second- order polynomial ax2 + bx + c. Use the quadratic equation. The inputs are the coefficients a,b, and c and the outputs are z1 and z2. The program should produce (exactly) the following output in the Command window when run with (a, b, c) = (1, 2, −3):

In: Computer Science

Q#5:    Clarify the important concepts relating to research design and the research design in case...

Q#5:    Clarify the important concepts relating to research design and the research design in case of descriptive and diagnostic research studies and the research design in case of hypothesis-testing research studies?

Mention the reference at the end.

Solution to be typed up to 500 words or 600 words.

In: Computer Science

Ameezaan is a famous wholesale mart and has its offices in Jalandhar, Phagwara and Hoshiarpur. Create...

Ameezaan is a famous wholesale mart and has its offices in Jalandhar, Phagwara and Hoshiarpur. Create a scenario for: Show IP addresses can be distributed automatically using DHCP Explain the flow of data packets using static routing .Explain flow of data packets using dynamic routing.

In: Computer Science

we are talking about the mc68000 microprocessor a) Explain possible scenarios that would set the V...

we are talking about the mc68000 microprocessor

a) Explain possible scenarios that would set the V bit of the Status Register in signed number arithmetic operations b) Name 3 Internal Bus and explain their usage and functionality in a microcontroller c) Explain how the displacement is calculated and how the PC gets updated when branching to a subroutine using BSR instruction d) Why do we use MOVEQ or ADDQ instead of MOVE or ADD instruction? (Explain with an example)

In: Computer Science

Design and implement a class Rectangle to represent a rectangle. You should provide two Constructors for...

Design and implement a class Rectangle to represent a rectangle. You should provide two Constructors for the class, the first being the default constructor and the second which takes the basic dimensions and sets up the private member variables with the appropriate initial values. Methods should be provided that allow a user of the class to find out the length, width, area and perimeter of the shape plus a toString()method to print the values of the basic dimensions. Now implement a class called Square that represents a square. Class Square must be derived from Rectangle. Make sure you override toString().

In: Computer Science

In Kali Linux, create two users Guest2 and Guest3. Use the user (for yourself in Question...

In Kali Linux, create two users Guest2 and Guest3. Use the user (for yourself in Question 1) to create a directory Ex-dir containing a text file File1.txt. I. Display the owner and group for the directory Ex-dir; (Take a screenshot of the command and its output) II. Change the group of the directory Ex-dir to Guest2; (Take a screenshot of the command) III. Change the permission mode of Ex-dir such that Guest 2 (as a group user) has permissions read and write. Try to create a file File2.txt in the directory with the 1 login users Guest 2 and yourself and check the difference. (Take a screenshot of the outputs) IV. Assign Guest3 (as other users) only execute permission to the directory. V. Can Guest3 display the content of File1.txt in the directory? Justify your answer.

In: Computer Science

Can you write code or class in java accepting from the user a + b as...

Can you write code or class in java accepting from the user a + b as a string and accepting their value from the user and the out but will be the sum of the variables.

In: Computer Science

Please explain answer so I can understand. 1. Write a C program that prints out its...

Please explain answer so I can understand.


1. Write a C program that prints out its command line arguments, one to a line.

Discussion: A C program starts at a function called main. main has two arguments, conventionally named argc and argv. argc is of type int; it’s the argument count, an integer that contains the number of command line arguments (including the program name). argv is the argument vector; it’s an array of pointers to characters, In C this is described as char *argv[] (or, equivalently and confusingly, char **argv - because C doesn’t really have arrays.)

Imagine that the command line is

% myprog pizza burrito kale

Then what’s actually happening is that somewhere in memory, when the program begins execution, the shell (working with the C runtime library) has arranged that the strings “myprog”, “pizza”, “burrito”, “kale” are stored somewhere in memory, AND that a table of four addresses - the addresses of the first characters of those strings - is also stored somewhere in memory. These addresses are pointers. In principle these strings can be anywhere but in practice they occupy consecutive memory locations. The diagram on the next page shows a picture in which I have arbitrarily chosen location 1128 as the address of the ‘m’ in “myprog” and 2020 as the address of the (nameless) table where the pointers to the strings are stored. In this example, the value of argc is 4 and the value of argv is 2020. The value of *argv is 1128. (What is its type?)The value of **argv is ‘m’. (What is its type? What is the value of argv[1]?)

2. Modify your program to print the arguments in reverse order.

In: Computer Science