CS143 – Lab 1
Sorted Set
Introduction
A set is an unordered collection of data that contains no duplicates. A sorted list is an ordered collection
of data that is always sorted using the elements’ natural order. A sorted set is a combination of the
above two ADTs having the following attributes:
• The collection is ordered, meaning it maintains the relative order of the elements, and
elements can be accessed by position.
• The collection is sorted, meaning that the order in which the elements are placed is based on a
comparison of the relative value of adjacent elements.
• The elements of the collection are all unique, meaning that no duplicates can be added.
A sorted set contains the following functions:
• add(value) – adds the value to the properly sorted place in the collection and returns the index
where it was added, or returns -1 if not added.
• remove(value) – deletes the value from the collection and returns true if successful, false if not.
• find(value) – reports the current index of a value in the collection, or -1 if not found.
• get(index) – returns the value at the given index
• size() – returns the number of elements currently stored in the collection.
Lab Overview
In the Lab 1 module you are given a NetBeans project that contains the following classes:
• A domain class called Player that represents a single player of an online game and their
personal high score. The class implements Comparable in order to help sort players from
highest score to lowest. It also contains an equals method based on player names to help
prevent duplicate players from being added.
• A data-management class called SortedSet that models the sorted set ADT described above.
(This class currently contains only stubs of methods.)
• A main class called Lab1 used to test the SortedSet.
Your job is to complete the SortedSet class. The following requirements and limitations apply:
• You must use a partially-filled array of Player objects as your underlying data storage.
• You must double the size of the array whenever it becomes too full to add another player, but
not before then.
• You may not use any methods in the Array, Arrays, or System classes to aid in array handling or
convert the array to another type of collection. Instead, write the necessary code based on
simple selection and repetition structures and good computer science logic.
• You must implement the variation of the insertion sort described in the lectures when adding a
value, as this is a very efficient algorithm when adding a single value to an already sorted list.
Attachments:
4084661_1_Lab1Requirements.pdf
4084661_2_Lab1.zip
Tag: Capstone
-
CS143 – Lab 1 – A set is an unordered collection of data that contains no duplicates. A sorted…
-
Identify the appropriate and correct syntax and programming constructs for different game…
Assignment Part C: Game Prototype
Overview
For this assessment task you are expected to construct a prototype level/area as a “proof of concept” for the game
that you have designed in Assignment Part B. The prototype should function with proper game logic utilizing selfcreated
and pre-made artistic and programming assets.
Timelines and Expectations
Percentage Value of Task: 25%
Due: 11pm Sunday of Week 11
Minimum time expectation: 25 hours
Learning Outcomes Assessed
The following course learning outcomes are assessed by completing this assessment:
• K5.Identify the appropriate and correct syntax and programming constructs for different game
development requirements.
• S1. Select and apply appropriate games development approaches to solve a real world game design;
• S2. Create a range of assets for a game’s project;
• S4. Use programming constructs to respond to user input and to create object and character behaviours;
• S5. Analyse, design and implement game concepts using structured and basic object orientated
programming concepts;
• S6. Test and debug code to correctly meet game design requirements.
• A1. Operate appropriate software packages to design and build games and interactive media products
that align with client and project expectations;
• A2. Utilise appropriate software environments to develop and integrate code implementations with game
assets.
Attachments:
4072304_1_Game-Design-Document-Bishnu-Kaini-30349769–2-.pdf
4072304_2_ITECH2001-PartC-GamePrototype–2-.pdf -
You are working on the morning shift on the ward, and receive a patient from ED. The ED nurse…
ACTIVITY 1 You are working on the morning shift on the ward, and receive a patient from ED. The ED nurse provides you with the following handover, using the ISBAR format. Further information about the ISBAR format can be found on page 7 of this module. Please click on the handover link in LEO within Module 3 section, titled: ‘Module 3 Activity 2 Verbal Handover’. Listen to this recording, and then please answer the following:
1. What further questions will you need to ask the nurse?
2. List specifically what further assessments you would complete when the patient arrives onto the ward & provide your rationale for each assessment.
Attachments:
4025655_1_Verbal-Handover.wav -
Task 1: Online discussion forum activity posts – From the forum titled: Forum – linked to…
Task 1: Online discussion forum activity posts (15%)
From the forum titled:
Forum – linked to Assessment 1 and 2 (seeded online forum Activities)’.
Take a screen shot of each of the following posts to your group forum and copy them onto your assignment document.
Weeks 9: Reply post to a peer and a self-post: due Monday 16th September by 12midnight
= 4 posts
Week 10: Reply post to a peer and a self-post: due Monday 23rd September by 12 midnight
Be sure to include in your capture your name and the date of posting.
Instructions: how to take a scree
n
shot:
Using snipping tool:
Go to your search icon located bottom left-hand side of your computer screen. Type in the search bar ‘Snipping tool’.
Click the desktop app – snipping tool. Find the word
New
click the down arrow, click Rectangular snip.
Drag the cursor around the area you want to snip. Click file, save as pictures. Create a folder NUR1201 Forum Posts. Save your capture in this folder.
Using control/alt/print screen (PrtScn)
Place the curser on the screen you want to copy.
Hold down the control and Alt tabs and click on print screen (PrtScn)
Place curser on the assignment doc and click on control V
Task 2: Case Scenario Reflection task using Gibbs 6 Stage Reflection Cycle
(adapted version by Burns and Bulman, 2000)
in an essay style (35%)
Case Scenario Recording:
‘The Age 75 Recording’
Two Topics of Focus for this case scenario:
1. ‘
Preventing falls and harm from falls’
2. ‘
My health record
’ (e-health record)
Background Information
Reflection is a way of thinking and working for Registered Nurses and is useful in raising our conscious awareness of aspects of care that may be hidden from our view. This raised awareness about these aspects of care improves our understanding as nurses and assist us in directing action strategies that can improve both the patient and their family’s experience and the ‘partnering in care’ strategies that we utilise. Improving the ‘patient care experience and partnering in care’ and using Gibbs 6 Stage Reflection Cycle (adapted version by Burns and Bulman 2000) as a framework in combination with drawing upon relevant theory provides a foundation for nurses to operate from and as such is required for Task 2.
Instructions:
View the Case Scenario – Recording ‘The Age 75 Recording’
This Recording is located at the top of this study desk page within the white ribbon, under useful links: course recordings
After viewing the ‘patient experience and partnering in care’
case scenario recording – ‘The Age 75
Patient Experience and Partnering in Care’, write a 1500-word reflection using
Gibbs 6 Stage Reflection Cycle (adapted version by Burns and Bulman, 2000) as the framework
, in an
essay style
.
Within your reflection aim to draw upon relevant literature/theory to help you analyse this patient experience with the goal to improve the care experience of patients and their families.
Drawing upon relevant literature (theory) will support and strengthen your reflection.
Attachments:
4025109_1_NUR1201-20S2-202019-20Assessment-202-20Tasks-CriteriaSheets-version-2017th-20July-202019.docx -
Write a program to calculate the amount of wood needed to be purchased in order to create a…
c++ program
a. Write a program to calculate the amount of wood needed to be purchased in order to create a rectangular wood frame.
b. Prompt the user for two inputs:
(1) One vertical dimension in inches
(2) One horizontal dimension in inches
c. The following should be calculated and outputted in the following order:
(1) The amount of wood needed in inches
(2) The amount of wood needed in feet (with a decimal answer if needed)
d. Save this program as
lab02a.cpp
e. Run the program with the following test data:
(1) One vertical dimension in inches = 40
(2) One horizontal dimension in inches = 60
2. Second program:
a. Write a program to calculate the final cost of items purchased with a discount applied.
b. Prompt the user for three inputs:
(1) Cost per item
(2) Number of items purchased
(3) Discount rate
c. A tax rate of 7 percent should be defined as a constant and the tax rate variable should be used for calculating the tax amount
d. The following should be calculated and outputted in the following order:
(1) Total cost before discount and before tax
(2) Discount amount
(3) Cost after the discount amount is applied
(4) Tax amount
(5) Final cost
e. Save this program as
lab02b.cpp
f. Run the program with the following test data:
(1) Cost per item = 5.75
(2) Number of items purchased = 10
(3) Discount rate = 15%
D. Verify all results before you submit the lab.
E. For each program, hand in:
1. A copy of the source code for each of the programs.
A copy of the screen print for the output for each of the programs -
In your implementation of the ALU there is no need to detect or handle overflow. However, it’s a…
In your implementation of the ALU there is no need to detect or handle overflow. However, it’s a good mental exercise to think about when/how an overflow might occur. When adding numbers with different signs, overflow cannot occur because the sum must be no larger than one of the numbers.
What happens when the signs of the numbers are the same? What happens in the case of subtraction?
How do we detect when an overflow does occur? -
Write a program that allows you to play rock, paper, scissors against the computer….
Write programs with iterators that computes:
• The sum of all even numbers between 2 and 100 (inclusive).
• The sum of all squares between 1 and 100 (inclusive).
• The product of all powers of 2 from 20 up to 220
.
• The product of all odd numbers between a and b (inclusive), where a and
b are inputs. (example, if a = 3, b = 7 then the product of odd numbers
between 3 and 7 is 3 * 5 * 7)
2. Write a program that allows you to play rock, paper, scissors against the computer.
Import the random module to select the computer’s choice.
3. A simple random generator is obtained by the formula rnew = (a×rold+b)%m and
then setting rold to rnew. Write a program that asks the user to enter an initial
value for rold. (Such a value is often called a seed). Then print the first 100 random
integers generated by this formula, using a = 32310901, b = 1729, and m = 224
.
4. In a predator-prey simulation, you compute the populations of predators and prey,
using the following equations:
preyn+1 = preyn × (1 + A – B × predn) (1)
predn+1 = predn × (1 – C + D × preyn) (2)
Here, A is the rate at which prey birth exceeds natural death, B is the rate of
predation, C is the rate at which predator deaths exceed births without food,
and D represents predator increase in the presence of food. Write a program
that prompts users for these rates, the initial population sizes, and the number of
Attachments:
3951600_1_Homework-2.pdf -
Using a combination of HTML/PHP, implement a web page where the users can upload a text file,…
Using a combination of HTML/PHP, implement a web page where the users can upload a text file, exclusively in .txt format, which contains a string of 400 numbers, such as:
Your code should contain a PHP function that, accepting the string of 400 numbers in input, is able to find the
greatest product of four adjacent numbers in all the four possible directions (up, down, left, right, or diagonally).
NOTE:
? You will need to arrange the numbers in a grid 20×20.
? If the file doesn’t contain 400 numbers or contains some characters in between, it should be discarded
and the application should inform the user that the file is not format correctly.
? You can ignore new lines and white spaces.
? Add a tester function to check the behavior of your PHP function.
? Follow the guidelines discussed and showed in class to avoid losing points.
Attachments:
4140316_1_midphp.pdf -
A tool and die press that stamps out cams used A tool and die press that stamps out cams used in…
A tool and die press that stamps out cams used
A tool and die press that stamps out cams used in small gasoline engines tends to break down once every five hours. The machine can be repaired and put back on line quickly, but each such incident costs $50. What is the probability that maintenance expenses for the press will be no more than $100 on a typical eight-hour workday?
A tool and die press that stamps out cams used -
identify and resolve errors and note incompleteness in the specifications. Your solution should…
2. For the Auto Dealership ERD shown in Figure 1, identify and resolve errors and note incompleteness in the specifications. Your solution should include a list of errors and a revised ERD. For each error, identify the type of error (diagram or design) and the specific error within each error type. Note that the ERD may have both diagram and design errors. Specifications for the ERD are presented in the following narrative.
Mountain High Quality Vehicles serves a metropolitan market with a medium size inventory of pre-owned cars and trucks. The vehicle inventory includes a variety of makes and models such as Acura, Chrysler, BMW, Cadillac, Ford, Chevrolet, Toyota, Honda, Mercedes-Benz, and more. A small staff manages the major functions of the business, purchasing, transporting, marketing, cleaning, maintaining, and selling the vehicles. They carefully inspect and certify the vehicles before they are available to the public for sale.
The dealership would like to develop an inventory management database to improve its tracking of vehicles, sales, and expenses. The dealership also would like to track information about its customers and car(s) sold to its customers.
·
Vehicle Acquisitions
: Periodically the owners attend auctions and purchase pre owned cars seeking reasonable prices and quality vehicles. They also purchase pre-owned vehicles from the wholesale market. The purchased vehicles are transported to the dealership and inspected for mechanical problems. Each vehicle is fixed and cleaned before being placed for sale.
·
Vehicle Improvements
: Apart from purchases, the dealership has additional expenses to prepare vehicles for market. The expenses typically involve transporting the purchased vehicle to the dealership, checking the vehicle for any potential problem, repairs and maintenance if necessary, marketing and cleaning.
·
Sales Details
: Customers purchase vehicles at the dealership. Each sale involves one customer even for married couples. Although customers can purchase more than one vehicle, each vehicle is recorded as a separate sale. When a sale is completed, the employee associated with the sale and payments are recorded. Typically, vehicles remain on the lot for a period of time before sales occur.
·
Vehicle Details
: The database tracks the unique vehicle identifier and vehicle identification number (VIN) to complete a sales transaction. The database also tracks vehicle characteristics such as make, model, year, mileage, exterior and interior colors, transmission type (automatic or manual), and number of cylinders (4 or 6).
·
Customer Details
: The database records the unique customer number, first and last names, address, city, state, postal code, primary phone number, and cellphone number.
·
Expense Details
: Each vehicle expense has a unique expense identifier, expense type, expense description, expense amount, expense paid date, account, and associated vehicle.
·
Account Details
: The database tracks account details such as a unique account identifier, account description, related expenses, and related payments.
·
Payment Details
: The database also tracks the vehicle sale (payment process). Each payment has a unique invoice number and payment method. The payment options are cash, credit card, or external line of credit as no financing is available at the dealership. Typically one payment is made per sale although multiple payments are sometimes made if a customer provides cash for part of the sale. If a customer is paying with a credit card, the payment includes the credit card number, expiration date, name on the credit card, and payment description. The employee that completed the sales transaction and vehicle should be recorded. The same employee works as sales associate and processes the payment to complete the sale. Each payment is associated with one account for company accounting purposes.
Figure 1: ERD for the Auto Dealership Database