In: Computer Science
C++ language
Using classes (OOD), design a system that will support lending various types of media starting with books. Program should be able to handle a maximum of 500 books. Program should meet at least the following requirements:
1. Define a base media class with a book class derived from it. (Specific class names determined by programmer.)
2. The classes should contain at least the following information: title, up to four authors, ISBN.
3. Define a collection class that will hold up to 500 books.
4. The program should be able to perform the following operations supported by the class definitions:
a) Load data from a drive
b)Sort and display the books by title
c)Sort and display the books by author
d)Add and remove books
Programming requirements: Must include examples of inheritance and composition
~~~Function/Class comments (Description, pre and post conditions)
~~~Internal comments for all functions
In: Computer Science
Python Program:
Description
Create an object-oriented program that uses inheritance to perform
calculations on a rectangle or a square.
Specifications
Sample Output (Your output should be similar or can be the same to the text in the following box)
|
Rectangle
Calculator Continue? (y/n): y Rectangle or square?
(r/s): s Continue? (y/n): n Thank you for using my app. |
In: Computer Science
In Python, Define an object-oriented class to represent a Sensorless Wheeled Robot, including:
(a) class data variables to store the robot’s x and y position.
(b) A class function or functions to move the robot by one distance unit in either positive or negative x, or positive or negative y dimensions. Include printed, informative output of each move and the resulting robot position
(c) A class function to navigate to the destination location by calling the class move functions (described above) • The destination object is passed in as a parameter to this function. • The obstacle position is also passed as a parameter to the function. • Reaching the destination does not require that the robot is rotated to ’face’ the destination in this model
In: Computer Science
In: Computer Science
Python:
def factors(matrix, factor):
The matrix is a 3D list of integers.
factors are either one, two, or three
If the factor is 'one' it will return a the first value from each list
if the factor is 'two' it will return the second value, and same for the third.
Example;
input = [ [ [1, 2, 3], [3, 2, 9], [9, 8, 6] ],
[ [0, 0, 4], [8, 9, 0], [5, 2, 1] ],
[ [0, 1, 1], [5, 5, 9], [3, 8, 4] ] ], 'one')
output = [ [1, 3, 9], [0, 8, 5], [0, 5, 3] ]
In: Computer Science
Explain the shortest seek time first, first come first serve, scan, and c scan algorithms of storage management algorithms with the single of the sequence (93, 176, 42, 148, 14, 180).
Draw good diagrams and CALCULATE the total distance traveled and the total waiting time.
initial position is at 50
In: Computer Science
In: Computer Science
1. Give, using “big oh” notation, the worst case running times of the following procedures as a function of n ≥ 0.
(a). procedure unknown
for i =1 to n – 1 do
for j =i + 1 to n do
for k =1 to j do
{statements requiring O(1) time}
endfor
endfor
endfor
(b). procedure quiteodd
for i =1 to n do
if odd(i) then
for j =i to n do
x ← x + 1
endfor
for j =1 to i do
y ← y + 1
endfor
endif
endfor
(c). function recursion (n)
if n <= 1 then
return (1)
else
return (recursion (n – 1) + recursion (n – 1))
endif
2.
The function max (i, n) given below returns the largest element in positions i through i + n – 1 of an integer array A. Assume for convenience that n is a power of 2.
function max(i, n)
if n = 1 then
return (A[i])
else
m1 ← max (i, n/2)
m2 ← max (i + n/2, n/2)
if m1 < m2 then
return (m2)
else
return (m1)
endif
endif
(a). Let T(n) denote the worst-case time taken by max with the second argument n. Note that n is the number of elements of which the largest is to be determined. Write an equation expressing T(n) in terms of T(j) for j < n and constants that represent the times taken by statements of the program.
(b). Obtain a big theta bound on T(n).
In: Computer Science
What is the legal business structure of the company (sole proprietorship, partnership, corporation, LLC/LLP, etc.)? Why was this legal business structure chosen?
In: Computer Science
| (16) Convert the following numbers into 8-bit hexadecimal values. | ||||
| Number | Binary | Complemented | Two's Complement | Hex |
| -102 | ||||
| -87 | ||||
| -31 | ||||
| (17) Add up the first two binary numbers from the previous problem in Two’s complement form. | ||||
| (17a) What is the sum in hex? | ||||
| (17b) What is the sign bit? | ||||
| (17c) Did overflow occur? | ||||
| (17d) Code this up in 68K and include a screenshot of the output here as well as your source & listing files. What happens? | ||||
Please show work!
If you can't do 17 d I understand, no worries!!!
In: Computer Science
I need to write a C++ program that will generate random numbers between the ranges of your own choice and within the random numbers, indicate the maximum, minimum and the average of the random numbers.
In: Computer Science
Given a csv file named “result_niwtawq.csv”, extract the data from it. Store the first column data to a list named time, second column data to a list named Turb_annual_avg, third column data to a list named Turb_min, fourth column data to a list named Turb_max, fifth column data to a list named Turb_mean. Calculate and write the average, maximumand minimumof Turb_min to a file named “lab3_output.txt”.
https://dropbox.cse.sc.edu/pluginfile.php/256369/mod_assign/introattachment/0/result_niwtawq.csv?forcedownload=1
In: Computer Science
The First National Bank of Parkville recently opened up a new “So You Want to Be a Millionaire” savings account. The new account works as follows:
Write a java program that prompts the user for a starting balance and then prints the number of years it takes to reach $100,000 and also the number of years it takes to reach $1,000,000.
Sample session:
Enter starting balance: 10000
It takes 4 years to reach $100,000.
It takes 7 years to reach $1,000,000.
In: Computer Science
3. Write a Java program to demonstrate the concept of priority thread. It should show that each thread have a priority. Priorities are represented by a number between 1 and 20. In most cases, thread schedular schedules the threads according to their priority (known as preemptive scheduling). But it is not guaranteed because it depends on JVM specification that which scheduling it chooses.
3 constants defined in Thread class:
1. public static int MIN_PRIORITY
2. public static int NORM_PRIORITY
3. public static int MAX_PRIORITY
Default priority of a thread is 5 (NORM_PRIORITY). The value of
MIN_PRIORITY is 1 and
the value of MAX_PRIORITY is 20.
Here is an example of priority of a Thread:
1. class TestMultiPriority1 extends Thread{
2. public void run(){
3. System.out.println("running thread
name is:"+Thread.currentThread().getName());
4. System.out.println("running thread
priority is:"+Thread.currentThread().getPriority());
5. }
6. public static void main(String args[]){
7. TestMultiPriority1 m1=new
TestMultiPriority1();
8. TestMultiPriority1 m2=new
TestMultiPriority1();
9. m1.setPriority(Thread.MIN_PRIORITY);
10. m2.setPriority(Thread.MAX_PRIORITY);
11. m1.start();
12. m2.start();
13.
14. }
15. }
In: Computer Science