Questions
''' Problem 2: Functions that give answers Define and complete the functions described below. The functions...

'''
Problem 2: Functions that give answers

Define and complete the functions described below.

The functions are called in the code at the very bottom. So you should be
able simply to run the script to test that your functions work as expected.
'''

'''
* function name: get_name
* parameters: none
* returns: string
* operation:
Here, I just want you to return YOUR name. The expected output below assumes
that your name is Paul. Of course, replace this with the real article.
* expected output:

# JUST RETURNS THE NAME...TO VIEW IT YOU CAN PRINT IT AS BELOW
>>> print(get_name())
Paul

'''

'''
* function name: get_full_name
* parameters: fname (string)
lname (string)
first_last (boolean)
* returns: string
* operation:
Return (again, NOT print) the full name based on the first and last names
passed in as arguments. The first_last argument will be True if you should
return the name as <fname lname> and False if you shoudl return the name
as <lname, fname>.
* expected output:

# AGAIN JUST RETURNS THE NAME...TO VIEW IT YOU CAN PRINT IT AS BELOW
>>> print(get_full_name("Paul","York",True))
Paul York
>>> print(get_full_name("Paul","York",False))
York, Paul

'''

'''
* function name: get_circle_area
* parameters: radius (float)
* returns: float
* operation:
Return the area of a circle with the given radius. Use 3.14 as Pi. And Google if for
some reason you've forgotten how to get the area of a circle.
* expected output:

# YET AGAIN JUST RETURNS THE VALUE
>>> print(get_circle_area(5.0))
78.5
>>> print(get_circle_area(2.5))
19.625

'''

# FUNCTIONS ARE CALLED BELOW HERE...NO NEED TO TOUCH ANYTHING
# UNLESS YOU WANT TO COMMENT SOMETHING OUT TO TEST THINGS
# ALONG THE WAY...

print(get_name())
print(type(get_name())) # >>> <class 'str'>
print(get_full_name("Darth","Vader",True))
print(get_full_name("Luke","Skywalker",False))
print(type(get_full_name("Han","Solo",False))) # >>> <class 'str'>
print(get_circle_area(5.0)) # 78.5
print(get_circle_area(2.5)) # 19.625
print(get_circle_area(12.25)) # 471.19625

In: Computer Science

File IO Java question • Ask the user to specify the file name to open for...

File IO Java question

• Ask the user to specify the file name to open for reading

• Get the number of data M (M<= N) he wants to read from file

• Read M numbers from the file and store them in an array

• Compute the average and display the numbers and average.

In: Computer Science

Java assignment Get a file name fname for output • Get number of data (numbers) (N)...

Java assignment

Get a file name fname for output

• Get number of data (numbers) (N) you want to process from the user

• Get N numbers from the users through keyboard and store them in an array

• Write the numbers into the file fname

In: Computer Science

Analyze the following codes by computing their running time, T(n). 1) int function ( int n)...

Analyze the following codes by computing their running time, T(n).

1)

int function ( int n) {
int sum;
for (int i = 0; i < n; i++)
​ sum = sum + (i * n);
return sum;
}


2)

int function(int n) {
​int sum;
​for (int i = 0; i < n; i++)
​​if (n < 1000)
​​​sum++;
​​else
​​​sum += function(n);
}

3)

int function(n)
{
​int s = 0;
​for (int i = 1; i <= n*n*n; i++)
​{
​​for (int j = 1; j <= i; j++)
​​{
​​​s = s + j;
​​}
​}
​return s;
}

In: Computer Science

a. Discuss the merits and demerits of using a single bus. b. How will the use...

a. Discuss the merits and demerits of using a single bus.

b. How will the use of a mezzanine bus architecture solve this problem?

c. Discuss various methods of bus arbitration.

In: Computer Science

Create shell scripts, .sh file. Please include a shebang line at the top of the script...



Create shell scripts, .sh file. Please include a shebang line at the top of the script as well as appropriate comments through out.

Write a script that plays a simple “guess the number” game with the user. It should select a random integer in the range [0 - 10], ask the user to guess the value, and provide feedback of the form “too high”, “too low”, or “congratulations” as appropriate. After the correct value is guessed, the script should terminate.

In: Computer Science

*Microprocessors* Write a program sequence that will test the byte STATUS and branch to ROOTINE_1 if...

*Microprocessors*

Write a program sequence that will test the byte STATUS and branch to ROOTINE_1 if bit 1, 2, or 4 is 1. Otherwise, it is a branch to ROUTINE_2 if both bits 1 and 3 are 1 and to ROUTINE_3 if both bits 1 and 3 are 0. In all other cases, it is to execute ROUTINE_4. Assume that the routines are more than 128 bytes long. Also, give a flowchart of the sequence.

In ASSEMBLY PROGRAM

In: Computer Science

your thoughts on what is UI? What is UX? What is VD? How are they different?...

your thoughts on what is UI? What is UX? What is VD? How are they different? Why do we have them? Why do you think this is so important to large companies?

120 words minimum

In: Computer Science

In R-Syntax, create a vector of 100 employees ("Employee 1", "Employee 2", ... "Employee 100") [Hint:...

In R-Syntax, create a vector of 100 employees ("Employee 1", "Employee 2", ... "Employee 100")

[Hint: use the `paste()` function and vector recycling to add a number to the word "Employee"] then create a vector of 100 random salaries for the year 2017

[Use the `runif()` function to pick random numbers between 40000 and 50000] and finally create a vector of 100 salary adjustments between -5000 and 10000 [use runif() to pick 100 random #'s in that range]

In: Computer Science

Write a C++ program that checks if the password is correct. The password is a 4-digit...

Write a C++ program that checks if the password is correct. The password is a 4-digit number combination. The program repeats to ask the password until the password is correct or you enter -1 to exit.

Input: The password is set to ‘1123’. A user input the password to proceed, or -1 to exit.

Sample Output: The program should display the following output. (The red text is a user input.)

Test case 1: when you enter the correct password.

Enter the password (or -1 to exit): 1234

Password is incorrect.

Enter the password (or -1 to exit): 1123

Password is correct. Test case 2: when you exit the program.

Enter the password (or -1 to exit): -1

You exit the program.

In: Computer Science

Discussion Prompt(s) VLANs and VTP What role do VLANs play in modern networks and network design?...

Discussion Prompt(s)

VLANs and VTP

What role do VLANs play in modern networks and network design?

How can the VLAN Trunking Protocol (VTP) and VTP Pruning be used by network administrators or technicians in order to increase overall efficiency?

From a network administration perspective, do you see any potential problems that could arise as a result of using VTP?

In: Computer Science

Given an array, write code to scan the array for a particular purpose. Given a class,...

Given an array, write code to scan the array for a particular purpose.

Given a class, write a getter and/or a setter.

Given a class with a list, write code that manages the list.

In: Computer Science

Write a simple Java program that does the following: 1) Declare a constant of type String...

Write a simple Java program that does the following:
1) Declare a constant of type String to hold the words "Oakland University".
2) Declare variables of the type stated, and Prompt the user to enter in the following information and store in the variables
a. Their current GPA on a 4.0 scale, into a variable of type double
b. The number of credits they have so far into a variable of type int
c. The amount of tuition they paid so far into a variable of type int
d. Their last name, into a String variable
e. Their first initial, into a char variable
3) Create a variable of type char. Determine and assign a letter grade to it using the following rules and if else statement. (Note: this is not our class grading scheme.)
a. gpa < 1 F
b. 1 <= gpa < 2.5 D
c. 2.5 <= gpa < 3 C
d. 3 <= gpa <= 3.5 B
e. 3.5 < gpa <= 4 A

4) Create a variable of type double. Cast the either of the variables tuition or credits to
double to calculate the tuition dollars per credit hour and assign it to the new variable. .
5) Print out to the system console a single String using escape characters that outputs
multiple lines with the following information, formatted the same as this example. In
other words, the first column should indicate what is being output, and the second column
shows the value. Use variable names in your output String, not literals. You can use tab
escape characters to set up the second column.
a. your first initial and last name, with a period and space following your first initial
(from problem 2)
b. your university (from problem 1)
c. your Letter GPA grade (from problem 3)
d. Your tuition cost per credit hour (from problem 4)

In: Computer Science

Write a project mission statement (including an introduction, product vision, and project scope) for a fictional...

Write a project mission statement (including an introduction, product vision, and project scope) for a fictional new software product.

Write at least FIVE user-level requirements for the product described above.

In: Computer Science

C++ Using what you know about inputs and outputs, code a simple ATM interaction. Your ATM...

C++

Using what you know about inputs and outputs, code a simple ATM interaction. Your ATM will start with only $500 to give out, and YOUR balance will be 1000. The amounts the ATM can dispense are $40, $80, $200 and $400. After you've received your disbursement, the console will show the amount you have left in your account, as well as how much the ATM has to dispense (we live in a small, fictional town - no one will use this information for nefarious purposes).

You may choose to use characters to show the interface, or just list the options for the user at the console.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Choose One

| $40 |$80

| $200 |$400

EXIT

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

In: Computer Science