Write a java program that prompts user to enter his name and KSU ID using format name-ID as one value, his gender as char, and his GPA out of 5. Then your program should do the following:
Print whether the ID is valid or not, where a valid ID should be
of length = 9, and should start with 4.
Calculate the GPA out of 100 which is calculated as follows GPA/5 *
100.
Update the name after converting the first letter to
uppercase.
Print “Mr.” before name if the gender is ‘M’, and print “Mrs.”
before name if the gender is ‘F’. Otherwise print message “invalid
gender” without name and GPA. Then print the new GPA.
In: Computer Science
Demand for oil changes at Garcia's Garage has been as follows:
|
Month |
Number of Oil Changes |
|
January |
33 |
|
February |
53 |
|
March |
56 |
|
April |
58 |
|
May |
69 |
|
June |
46 |
|
July |
62 |
|
August |
69 |
a. Use simple linear regression analysis to develop a forecasting model for monthly demand. In this application, the dependent variable, Y, is monthly demand and the independent variable, X, is the month. For January, let X=1; for February, let X=2; and so on.
The forecasting model is given by the equation Y =4 0.86 +3.31X.
(Enter your responses rounded to two decimal places.)
b. Use the model to forecast demand for September, October, and November. Here,
X=9, 10, and 11, respectively. (Enter your responses rounded to two decimal places.)
|
Month |
Forecast for the number of Oil Changes |
|
September |
|
|
October |
|
|
November |
In: Operations Management
Outcomes: • Write a Java program that implements linked list algorithms
can u also show thee testing code
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is the starter code
import java.util.NoSuchElementException;
// Put your prologue comments here
public class LinkedAlgorithms {
private class Node {
private String data;
private Node next;
private Node(String data)
{
this.data =
data;
this.next =
null;
}
}
public Node head;
public int numItems;
/**
* Creates the empty list.
*/
public LinkedAlgorithms() {
}
/**
* Creates a list containing all the elements of the
passed array.
* {@code data[0]} will be the first element of the
list, {@code data[1]} will
* be the second element of the list, and so on.
*
* @param data The array of values
* @throws NullPointerException - data is null
*/
public LinkedAlgorithms(String[] data) {
}
/**
* Constructs a deep copy of the linked list {@code
original}
*
* @param original The list to be copied
* @throws NullPointerException - original is
null
*/
public LinkedAlgorithms(LinkedAlgorithms original)
{
}
/**
* Returns array with all the elements.
*
* @return Array containing all elements.
*/
public String[] toArray() {
return null;
}
/**
* Formats the elements in the list using leading and
ending brackets (i.e., []), with the values comma separated.
* There will be one space between each of these but
none at the beginning nor at the end.
* Some examples:
* if the list is empty, toString() gives []
* if the list has these three elements in this order:
"hello", "world", "everyone", then the result should be
* [hello, world, everyone]
*/
@Override
public String toString() {
return null;
}
/**
* Returns the number of items in the list
*
* @return Number of items in the list
*/
public int size() {
return 0;
}
/**
* Determines if two lists contain exactly the same
values, in exactly the same
* order.
*
* @return {@code true} if and only if obj is an list
that is equivalent to the
* incoming list.
*/
public boolean equalsLinkedList(LinkedAlgorithms obj)
{
return false;
}
/**
* Determines if {@code key} is in the linked
list.
*
* @param key The value to be found
* @return true if and only if {@code key} is in the
list
*/
public boolean contains(String key) {
return false;
}
/**
* Determines the index of {@code key}. -1 is returned
if the value is not
* present in the linked list. If {@code key} is
present present more than once,
* the first index is returned.
*
* @param key The value to be found
* @return The index of the {@code key}
*/
public int find(String key) {
return 0;
}
/**
* Returns the value of the first element of the
list.
*
* @return The first element of the list.
* @throws NoSuchElementException the list is
empty
*/
public String getFirst() {
return null;
}
/**
* Returns the value of the last element of the
list.
*
* @return The last element of the list.
* @throws NoSuchElementException the list is
empty
*/
public String getLast() {
return null;
}
/**
* Returns the value of the {@code ith} element of the
list (0 based).
*
* @param i The target index
* @return The value of the ith element of the
list.
* @throws IndexOutOfBoundsException {@code i} is
illegal
*/
public String getAt(int i) {
return null;
}
/**
* Adds {@code data} to the beginning of the list. All
other values in the list
* remain but they are "shifted to the right."
*
* @param data The value to add to the list
*/
public void insertFirst(String data) {
}
/**
* Adds {@code data} to the end of the list. All other
values in the list remain
* in their current positions.
*
* @param data The value to add to the list
*/
public void insertLast(String data) {
}
/**
* Adds data to a specific spot in the list. The values
in the list remain
* intact but {@code data} is inserted in the list at
position {@code i}. When
* {@code i=0}, the result is the same as {@code
insertFirst}.
*
* @param i The target index
* @param data The value to add to the list
* @throws IndexOutOfBoundsException {@code i} is
illegal
*/
public void insertAt(int i, String data) {
}
/**
* Adds {@code newData} the position immediately
preceding {@code existingData}.
* If the {@code existingData} appears multiple times,
only the first one is
* used.
*
* @param newData The value to add to the list
* @param existingData The value used to control where
insertion is to take
* place
* @throws NoSuchElementException {@code existingData}
is not in the list
*/
public void insertBefore(String newData, String
existingData) {
}
/**
* Adds {@code newData} the position immediately after
{@code existingData}. If
* the {@code existingData} appears multiple times,
only the first one is used.
*
* @param newData The value to add to the list
* @param existingData The value used to control where
insertion is to take
* place
* @throws NoSuchElementException {@code existingData}
is not in the list
*/
public void insertAfter(String newData, String
existingData) {
}
/**
* Removes the first element of the list. The remaining
elements are kept in
* their existing order.
*
* @return The value removed from the list
* @throws NoSuchElementException if the list is
empty.
*/
public String removeFirst() {
return null;
}
/**
* Removes the last element of the list. The remaining
elements are kept in
* their existing order.
*
* @return The value removed from the list
* @throws NoSuchElementException if the list is
empty.
*/
public String removeLast() {
return null;
}
/**
* Removes the ith element of the list. The remaining
elements are kept in their
* existing order.
*
* @param i The target index
* @return The value removed from the list
* @throws IndexOutOfBoundsException i does not
represent a legal index
*/
public String removeAt(int i) {
return null;
}
/**
* Removes the first occurrence of data in the linked
list.
*
* @param data The value to be removed.
* @return {@code true} if and only if {@code data} was
removed
*/
public boolean removeFirstOccurrenceOf(String data)
{
return false;
}
/**
* Removes the all occurrence of {@code data} in the
linked list.
*
* @param data The value to be removed.
* @return The number of times {@code data} was
removed
*/
public int removeAllOccurrencesOf(String data) {
return 0;
}
/**
* Reverses the elements in the incoming linked
list.
*/
public void reverse() {
}
/**
* Puts all the elements in the list to
uppercase.
*/
public void toUpper() {
}
/**
* Returns the concatenation of all strings, from left
to right. No extra spaces
* are inserted.
*
* @return Concatenation of all string in the
list
*/
public String getConcatenation() {
return null;
}
/**
* Returns the alphabetically last value in the
list.
*
* @return The alphabetically last value in the
list
* @throws NoSuchElementException list is empty
*/
public String getAlphabeticallyLast() {
return null;
}
/**
* Returns the index where the alphabetically last
value value resides. If this
* value appears multiple times, the first occurrence
is used.
*
* @return Index value of where maximum value
resides
* @throws NoSuchElementException list is empty
*/
public int indexOfAlphabeticallyLast() {
return 0;
}
/*
* Determines if the two list contain elements that
have exactly the same
* value, with the same list sizes, but with the
elements perhaps in different order.
*
* @returns true only if the two lists are permutations
of one another.
*/
public boolean anagrams(LinkedAlgorithms other)
{
return false;
}
public static void main(String[] args) {
String[] items = { "hello", "world"
};
LinkedAlgorithms LL1 = new
LinkedAlgorithms();
LinkedAlgorithms LL2 = new
LinkedAlgorithms(items);
LinkedAlgorithms LL3 = new
LinkedAlgorithms(LL1);
}
}
In: Computer Science
In response to a growing awareness of gluten allergies, Carla Vista Bakery tried using gluten-free flour in its three most popular cookies. After several attempts and a lot of inedible cookies, the company perfected new recipes that yield delicious gluten-free cookies. The costs of producing a batch of 100 cookies are as follows:
|
Chocolate Chip |
Sugar |
Oatmeal Raisin |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sales price | $129.20 | $111.00 | $131.60 | |||||||||
| Variable cost | $80 | $63 | $89 | |||||||||
| Fixed cost | 19 | 16 | 19 | |||||||||
| Total cost | 99.00 | 79.00 | 108.00 | |||||||||
| Gross profit | $30.20 | $32.00 | $23.60 | |||||||||
| Pounds of flour | 2 | 2 | 1.5 | |||||||||
Assuming no raw material constraints and unlimited demand for cookies, calculate contribution margin per batch for Chocolate Chip, Sugar, Oatmeal Raisin cookies. (Round answers to 2 decimal places, e.g. 52.75.)
| Cookies | Contribution Margin | |
|---|---|---|
| Chocolate Chip | $Enter a dollar amount rounded to 2 decimal places | |
| Sugar | $Enter a dollar amount rounded to 2 decimal places | |
| Oatmeal Raisin | $Enter a dollar amount rounded to 2 decimal places |
What type of cookie would maximize the company’s contribution
margin?
| Select a type of cookie SugarChocolate ChipOatmeal Raisin |
Assume that, based on typical customer demand, Carla Vista will sell 12,700 batches of chocolate chip cookies, 8,700 batches of sugar cookies, and 10,700 batches of oatmeal raisin cookies. What will the company’s contribution margin be?
| The company’s contribution margin | $Enter the company’s contribution margin in dollars |
Carla Vista’s flour supplier has announced a shortage of
gluten-free flour. As a result, Carla Vista will only be able to
purchase 41,450 pounds of flour.
How many batches of each type of cookie should the company
bake?
| Batches | ||
|---|---|---|
| Chocolate Chip | Enter a number of batches | |
| Sugar | Enter a number of batches | |
| Oatmeal Raisin | Enter a number of batches |
What will the company’s contribution margin be?
| The company’s contribution margin | $Enter the company’s contribution margin in dollars |
If Carla Vista uses gluten-free flour in other products, will the allocation you recommend in part (c) change?
| Select an option NoYes |
In: Operations Management
You are required to design and fabricate a composite material to be used for machining hard steels. Use the information presented in your lecture notes and:
i) Identify the type of a composite that you would like to design, then select the appropriate reinforcement and matrix and fully justify your selection.
ii) Select a fabrication route for the designed composite and justify your fabrication process selection with respect to temperature and time
In: Mechanical Engineering
Build a module (file with pre-defined functions) that allows the following code to work properly. The code below should be able to run without any additions or modifications. You may copy and paste it into a file called file_tools_assignment.py and place it in the same directory as the file you will create. The filename of the file you will create should be file_tools.py. The module should contain 2 custom defined functions; get_file_string() and get_file_list(). Download the data.txt file and place it in the same directory with your other two files.
Contents for file_tools_assignment.py:
import file_tools filename = 'data.txt' contents = file_tools.get_file_string(filename) print(contents) list_of_lines = file_tools.get_file_list(filename) print(list_of_lines)
(5 points) The get_file_string() function should attempt to get the contents of a file and return it as a string. If no file exists, the return value should be None.
(5 points) The get_file_list() function should return a list where each element in the list corresponds to a line in the file. Note: no newline characters should be present in the elements of the list. Remove those before adding the elements to the list that gets returned. If no file exists, the return value should be an empty list.
Sample output (3 lines in data.txt):
hello world
I love programming
Python rocks!
['hello world', ' I love programming', 'Python rocks!']In: Computer Science
Assume all methods in the Stack class are available to you, request from the user a set of numbers (terminated by -1) and print them in reverse order . write code in java.
In: Computer Science
Define critical success factors (CSFs) and key performance indicators (KPI) Explain how managers use them to measure the success of MIS projects. and some examples about (Sabic) company for critical success factors and key performance indicators (900 wards)
In: Operations Management
Implement the bubble sort in ML using pattern matching and local function definitions. Show that it works with a few simple examples. A nice description of the bubble sort can be found on Wikipedia.
A helpful function for the bubble sort is:
(* General function that checks if an int list is sorted *)
fun issorted [] = true
| issorted [x] = true
| issorted (x::y::t) = x <= y andalso issorted(y::t);
Test your solution and show that it works on the following examples:
bubbleSort []; → []
bubbleSort [1]; → [1]
bubbleSort [1,2,3]; → [1,2,3]
bubbleSort [3,1,2]; → [1,2,3]
bubbleSort [5,4,3,2,1]; → [1,2,3,4,5]
In: Computer Science
In: Operations Management
What type of market structure is the cricket ball product line of Kookaburra Sport fall under? Would it be imperfect competition or an oligopoly? How would I determine this?
In: Economics
Number conversion between hexadecimal and binary. Show the working steps. a) Convert the hexadecimal number E4D2 into binary. b) Convert the binary number 1100010111110011 into hexadecimal
In: Computer Science
If a professor had an Indian student in class and the student asked the professor to not pass out handouts with his left hand, do you think the professor should comply?
In: Psychology
Question 1 (30 marks, maximum 300 words)
When a business expands its operation into other countries, the impact of globalization on human resource development and management is significant.
In: Operations Management
In: Psychology