Problem 1: based on java.util.LinkedList class, create MyQueue class that should have the methods:enqueue(), dequeue(), peek(), size(), isEmpty().
Problem 2: Create a new Java Application that test MyQueue by having the following methods in main class:
A method to generate a number of element between two given values and save them in a queue
A method to print a queue (10 elements per line). The original queue should remain as is after the print
A method to exchange the first element and the last element in a queue
A Boolean method to search for a value in a queue. The queue should remain the same after the search is
finished.
A method to check if a queue is included in another queue (q1 is included in q2 if q1 is a sub-queue of q2). q1
and q2 should remain as they were originally.
A method to inverse a queue.
A method to make a copy of a queue into a queue (the original queue should remain as it is).
The main method that does
Create 2 queues Q1 and Q2
Insert 23 integers between 20 and 60 (do not insert duplicates) into Q1
Insert 35 integers between 10 and 80 (do not insert duplicates) into Q2.
Give the user the choice which methods (2-7) to call and option to exit
In: Computer Science
using java and use stack library java
Bashemin Parking garage
The Bashemin Parking Garage contains a single lane that holds up to ten cars. There is only a single entrance/exit to the garage at one end of the lane. If a customer arrives to pick up a car that is not nearest the exit, all cars blocking its path. are moved out, the customer's car is driven out and the other cars are restored in the same order that they were in originally.
Write a program that processes a group of input lines. Each input line contains an "A" for arrival or a "D" for departure and a license plate number. Cars are assumed to arrive and depart in the order specified by the input. The program should print a message whenever a car arrives or departs. When a car arrives, the message should specify whether or not there is room for the car in the garage. If there is no room the car leaves without entering the garage. When a car departs, the message should include the number of times that the car was moved out to allow other cars to depart.
You will submit a program listing (properly commented), your sample data (at least 20 lines of text) and the output.
In: Computer Science
You have been asked to carry out use case modelling to identify
the functional requirements for a new fitness app (provisionally
named FitFoodFastFacts) which is targeted at users who want to
track their food intake and balance it with their exercise profile
and goals, similar to the functionality provided by MyFitnessPal,
Fooducate, MyPlate, and others.
The target user of FitFoodFastFacts is anyone who is interested in
monitoring their food intake in order to gain a better
understanding of their nutrition, or to gain or lose weight.
Users will be able to customise the app for their own profile and
needs: for example, gender, age, height, weight, target weight,
target kilojoules and target macros (percentage of carbohydrates,
protein and fat consumed per day). They will also be able to record
their activities each day (run, swim, etc). They will be able to
select a food from the app’s database and record the quantity they
consumed of it at each meal. They will also have the ability to add
new nutritional information either manually or by scanning the
barcode of the product. The app will provide a range of useful
summaries of the personal data input by the user over various time
periods.
Use the user goal technique to identify all the use cases that
would be relevant to a potential user of the FitFoodFastFacts app.
Use the brief description above, your own experience or potential
requirements of such an app, and any research you need to do.
(a) Present your list in a table giving the use case name and an
informative brief description.
(b) Draw a use case diagram representing the same information
In: Computer Science
Question 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risksQuestion 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risksQuestion 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risksQuestion 3 (Marks: 15) Q.3.1 Discuss any three items you would consider when determining the cost of the proposed project. In your answer state why each item is important to consider. (9) Q.3.2 Explain what a contract is and then identify a suitable contract type for Project A and Project B below: A You think that your project is well defined and carries little risk. B You think that your project involves risks
In: Computer Science
Matlab
For a vector x=[1,10,-5,72,56,70,33] a) Use for loop to sum the vector x and count how many values are greater than 33. b) Repeat (a), this time a while loops.
In: Computer Science
Write a 6 pages report explaining Micro controllers based on the following classifications:
1) Bits - 4, 8 , 16, 32 .
2) Memory / device - Embedded , external.
3) Instruction set - CISC, RISC
4) Memory Architecture - Princeton, Harvard
5) Family - 8051, Motorola, PIC , Texas, National , ARM, Intel , Phillips, Siemens,.
From the 6 pages report, draft out a 3 page Powerpoint presentation explaining your report.
In: Computer Science
The goal of designing a direct manipulation interface is to make use of the system intuitive to the end user. Direct-manipulation interfaces are now being used for a wide range of purposes.
Describe how direct manipulation interfaces are designed in the following applications.
1. Checkbook maintenance and checkbook searching interface
2. Airline reservation system
In: Computer Science
In: Computer Science
Consider the following database schema:
LIKE(person, sport),
PRACTICE(person, sport),
where person and sport are keys in both tables. The table LIKE gives the sports a person likes, the table PRACTICE gives the sports a person practices. We assume that a person likes at least one sport and practices at least one sport. We assume also that a person does not like a sport if the sport is not listed among the sports that person likes
In: Computer Science
Complete the following functions. You MUST, MUST, MUST add:
1) a doc comment in the proper location for EACH function that
describes
the basic purpose of the function.
2) AT LEAST 5 doc test comments in EACH function that:
* test that the function does what it is supposed to do
* tests that it does what it's supposed to do with odd inputs
* tests "edge" cases (numbers at, just above, just below min/max,
empty strings, etc.)
You MUST, MUST, MUST then test each of your methods by BOTH:
1) running the "main.py" script
2) running this module directly to run the doc tests
Except as noted, you can implement the functions however you
like. And if your grade-school
math's out of date, Google's your friend for formulas (BUT NOT FOR
CODE).
CHALLENGE: Use try/except blocks to avoid crashes when passing in unexpected parameters.
circle_area
-----------
RETURN the area of a circle with a radius supplied by the
parameter.
Note that you MUST use the "pi" constant from the math module,
so
use an import statement. If the radius passed is less than 1
or
greater than 1000, PRINT "ERROR" and RETURN 0.
sphere_surface_area
-------------------
RETURN the surface area of a sphere with the supplied radius.
Slightly
different error check here: if the radius passed is less than 1
or
greater than 250, PRINT "ERROR" and RETURN 0.
sphere_volume
-------------
RETURN the volume of a sphere with the supplied radius. Again,
slightly
different error check here: if the radius passed is less than 1
or
greater than 100, PRINT "ERROR" and RETURN 0.
'''
# IMPORT THAT PI CONSTANT HERE
def circle_area(radius):
def sphere_surface_area(radius):
def sphere_volume(radius):
if __name__ == "__main__":
import doctest
doctest.testmod()
In: Computer Science
An online air ticket reservation company is experimenting with a new interactive user interface design for its customers. Study any leading online air ticket reservation system to understand this interface and using it, give examples of any three social impact of interface design for following elements. You can use screenshots to elaborate your example.
In: Computer Science
Operating Systems Concepts
In: Computer Science
Compare the segmented paging scheme with the hashed page table scheme for handling large address spaces. Under what circumstances is one scheme preferable to the other?
In: Computer Science
Company X database
Create an ER Diagram using UML notation for the following tables, then write out in the Relational model.
Company X is a manufacturing company that binds and sells books. They have hired you to create database to track their Employees, Products, customers and their orders. All employees work with book Binding, Only some are designated as Reps for customers. Reps may have many customers.
But each customer can only have 1 rep. They count to record each Books author, title, price, published year, publisher, and ISBN#
In: Computer Science
use cout to print the address at which the following array is stored in memory
long double computers[24]
a. print the adress of the last element
b. print the address of the tenth element.
c. print the address of the first element in the array
In: Computer Science