NEED DONE IN AN HOUR
File 1 - HotTubLastname.java
The capacity of the hot tub can be calculated by using the following formula:
Capacity in gallons = (Length * Width * Depth) / 1728 * 4.8
Hot Tub Capacity |
Package |
Cost Per Gallon |
Less than 350 gallons |
Basic |
$5.00 |
Less than 350 gallons |
Premium |
$6.50 |
350 but not more than 500 gallons |
Basic |
$6.00 |
350 but not more than 500 gallons |
Premium |
$8.00 |
Over 500 gallons |
Basic |
$7.50 |
Over 500 gallons |
Premium |
$10.00 |
Price = Cost Per Gallon * Capacity
File 2 - DemoLastname.java
In: Computer Science
How will you, as the project manager, know whether the project is following the desired path as per the project measurement plan? Please provide a detailed answer.
In: Computer Science
***JAVA PROGRAM
Write a method called shrink that accepts an array of integers (that the user inputs) as a parameter and returns a new array containing the result of replacing each pair of integers with the sum of that pair. For example, if an array called list stores the values {7, 2, 8, 9, 4, 15, 7, 1, 9, 10}, then the call of shrink(list) should return a new array containing {9, 17, 19, 8, 19}.
The first pair from the original list is shrunken into 9 (7 + 2),
the second pair is shrunken into 17 (8 + 9), and so on.
If the list stores an odd number of elements, the final element is not collapsed. For example, if the list had been {1, 2, 3, 4, 5}, then the call would return {3, 7, 5}. Your method should not change the array that is passed as a parameter.
Be sure to have a shrink() method
*All variable names are completely up to you, as long as they’re descriptive
*Use the correct data types
*Use comments to explain what you’re coding
*Put your name in a comment
In: Computer Science
1) How do you extract a part of a string? Give the command and examples (in arduino)
2) Explain how negation and comparison operators combine together. (in Arduino)
3) What are the qualifiers? (in Arduino)
4) List the increment and decrement operators. (in Arduino)
In: Computer Science
Flow this Code to answer question below
#include <iostream>
using std::cout;
struct Node {
int data;
Node *link;
Node(int data=0, Node *p = nullptr) { //Note, this constructor combines both default and parameterized constructors. You may modify the contructor to your needs
this->data = data;
link = p;
}
};
class linked_list
{
private:
Node *head,*current;
public:
//constructor
linked_list() {
head = nullptr;//the head pointer
current = nullptr;//acts as the tail of the list
}
//destructor - IMPORTANT
~linked_list() {
current = head;
while( current != nullptr ) {//the loop stops when both current and head are NULL
head = head->link;
delete current;
current = head;
}
}
void addLast(int n) {// to add a node at the end of the list
if(head == nullptr){
head = new Node(n);
current = head;
} else {
if( current->link != nullptr)
current = current->link;
current->link = new Node(n);
current = current->link;//You may decide whether to keep this line or not for the function
}
}
void print() { // to display all nodes in the list
Node *tmp = head;
while (tmp != nullptr) {
cout << tmp->data << std::endl;
tmp = tmp->link;
}
}
};
int main() {
linked_list a;
a.addLast(1);
a.addLast(2);
a.print();
return 0;
}
Question:
Create the node structure and the linked list class. The sample class has implemented the following member methods:
o constructor
o destructor
o print(),
o addLast()
2. Implement the following member methods:
▪ addFirst (T data) // Adds a node with data at the beginning of the list
▪ pop() // Removes the first node of the list. Note: Don't forget to delete/reallocate the removed dynamic memory
▪ contains(T data) // Returns true or false if a node contains the data exists in the list
▪ update(T oldDate, T newData) // Updates the oldData of a node in the list with newData.
▪ size() // Returns the number of nodes in the list
▪ remove( T data) //Removes the node that contains the data. Note, you will need to check if the node exists. Again, don't forget to delete/re-allocate the dynamic memory
3. (Extra Credit Part) Implement the following additional member methods
▪ insertAfter(int n, T data) //Adds a node after the n-th node. Note, you will need to check if the n th node exists, if not, do addLast().
▪ merge(const LinkedList &linkedlist) //Merges this object with linkedlist object. In other words, add all nodes in linkedlist to this object.
In: Computer Science
create a program that asks the user’s height
In: Computer Science
For this task you will create a Point3D class to
represent a point that has coordinates in three dimensions labeled
x, y and z. You will then use the class
to perform some calculations on an array of these points. You need
to draw a UML diagram for the class (Point3D) and then
implement the class.
The Point3D class will have the following state and
functionality:
Write a TestPoint3D class that will have a main method, and perhaps other methods as required by good design, to test your Point3D class. It will not have user input because this class will stand as a record of the tests you have applied and you will be able to run it whenever you alter your Point3D class. For the TestPoint3D class you will need to do the following:
In: Computer Science
In: Computer Science
PART A
Write a C program that takes the names and surnames of the students and then displays the initial and last name of the name on the screen. For instance, if Onur Uslu is entered as input, the output of our program must be O. Uslu.
PART B
Write a C program that asks the user to enter a string and then sends it to a function that does the following job and shows the response from the function on the screen. The function must return all words in the string from the program by converting the initial letters into their large form.
Example Output
Type of a string:Hello world
New sentence:Hello World
In: Computer Science
Think of an algorithm to find the maximum value in an (unsorted) array. Now, think of an algorithm to find the second largest value in the array. Which is harder to implement? Which takes more time to run (as measured by the number of comparisons performed)? Now, think of an algorithm to find the third largest value. Finally, think of an algorithm to find the middle value. Which is the most difficult of these problems to solve?
In: Computer Science
Objective: Design and test a 4-bit Right shift register with serial input.
Part I
Use D flip-flops (FF) in your design (Memory → D Flip-Flop). Ensure the output of each FF (Q) goes to an output so the functionally of the shift register can be verified. All 4 Flip-Flop need to share a common clock which is connected to an input you can control. Verify the functionally of the circuit by changing the input value and toggling the clock. You should see the value in the register shift to the right.
Part II
Modify the circuit so that if the register contains 1010 OR 0111 an output signal goes active (logic 1). Verify the functionally of the circuit by shifting in the two values to be detected and ensure the output goes high (logic 1).
Please use some kind of software and attach screenshots
In: Computer Science
file.seekp(100L, ios::beg);
file.seekp(-10L, ios::end);
file.seekg(-25L, ios::cur);
file.seekg(30L, ios::cur);
file.open("info.dat", ios::in | ios::out);
file.open("info.dat", ios::in | ios::app);
file.open("info.dat", ios::in | ios::out | ios::ate);
file.open("info.dat", ios::in | ios::out | ios::binary);
In: Computer Science
In: Computer Science
only the Java programInstructions:
This project has three parts. Remember to make a copy of this project so you can refer to it when completing the other phases.
Review the sample program before starting this project. The sample program does not exactly match the requirements for this project, so some critical thinking will still be required; however, it is a good thing to reference before starting the project.
Project 2 is a continuation of Project 1. Modify the code from Project 1 in the following ways:
Step 1: Add code to prompt the user to enter the name of the room that they are entering information for.
Step 2: Add Input Validation to the code using the following rules:
If the user's input is invalid, the program should display an appropriate error message and prompt the user to re-enter their input. The user should be given an unlimited amount of attempts to enter valid input
Step 3: Add code to have the program ask the user if they would like to enter information about another room after the information for a previous room has been processed and displayed. The user should be able to enter a "y" or "Y" to indicate that they want to enter information about another room. See the Sample Input and Output for how to format this.
Step 4: After the user has indicated that they do not wish to enter information about another room, the program should output the number of rooms that have been entered and then stop executing.
Sample Input and Output (user input is in bold) - The output of your program should match the formatting and spacing exactly as shown
Please enter the name of the room: Guest
Bedroom
Please enter the length of the room (in feet):
15.5
Please enter the width of the room (in feet):
10
What is the amount of shade that this room receives?
Please select from the options above: 3
Air Conditioning Window Unit Cooling Capacity
Room Name: Guest Bedroom
Room Area (in square feet): 155.0
Amount of Shade: Abundant
BTUs Per Hour needed: 4,950
Would you like to enter information for another room (Y/N)? Y
Please enter the name of the room:
Kitchen
Please enter the length of the room (in feet):
20
Please enter the width of the room (in feet):
15
What is the amount of shade that this room receives?
Please select from the options above: 2
Air Conditioning Window Unit Cooling Capacity
Room Name: Kitchen
Room Area (in square feet): 300.0
Amount of Shade: Moderate
BTUs Per Hour needed: 10,000
Would you like to enter information for another room (Y/N)? N
The total number of rooms processed was: 2
In: Computer Science
Write a c++ program that asks the user to choose his preferred shape, and asks then for two numbers (positive but not necessary integers) in order to calculate the shape's area.
The possible shapes are: Triangle, Ring and Rectangle. If the user chose a different shape, you
will warn him and wait for a valid shape.
While the user will enter the values in cm , the program will display the number of paint bottles
needed to paint the area of the shape. Each bottle can cover 5cm^2. The number of paint bottles should be an integer value.
In: Computer Science