Questions
I need this in C# with pseudocode Exercise #2: Design and implement a programming (name it...

I need this in C# with pseudocode

Exercise #2: Design and implement a programming (name it EvenOdd) that uses a while loop to determine and print out all even numbers between 50 and 100 on a single line, separated by commas. Then another while loop in the same program to print out all odd numbers between 50 and 100 on a new line, separated by commas. Document your code and properly label the outputs as shown below.

Even numbers between 50 and 100: 50, 52, 54, 56, 58, 60, 62, 64, …

Odd numbers between 50 and 100: 51, 53, 55, 57, 59, 61, 63, 65, …

In: Computer Science

All code in JAVA please 1. Implement Insertion Sort 2. Implement Selection Sort *For problem 1...

All code in JAVA please

1. Implement Insertion Sort

2. Implement Selection Sort

*For problem 1 and 2, please:

a. Let the program generate a random array.
b. Output both the original random array and the sorted version of it

In: Computer Science

In c++: Code Challenge Consider the following code: struct ListNode { int value; struct ListNode *next;...

In c++:

Code Challenge

Consider the following code:

struct ListNode { int value; struct ListNode *next; };

ListNode *head; // List head pointer

Assume that a linked list has been created and head points to the first node. Write code that traverses the list displaying the contents of each node’s value member

Now write the code that destroys the linked list

In: Computer Science

Problem specifications: You are tasked with developing a complete temperature conversion program in Java. Your program...

Problem specifications:

You are tasked with developing a complete temperature conversion program in Java.

Your program should:

-prompt the user with the following menu:

-1-Convert Fahrenheit to Celcius

-2-Convert Celcius to Fahrenheit

-3-Quit Program

The menu must be coded in its own method.

-If user select option 1 then call a method that prompts the user to enter a value in degrees Fahrenheit and return it back to main.

-call a method that converts from Fahrenheit to Celcius

-call a method that displays the degrees in Fahrenheit and its equivalent in degress celcius.

-If user select option 2 then call a method that prompts the user to enter a value in degrees Celcius and return it back to main.

-call a method that converts from Celcius to Fahrenheit.

-call a method that displays the degrees in Celcius and its equivalent in degress celcius.

-if user select option three, abort the process and display a suitable message to that effect.

-the program must repeat the whole processes until user select 3.

-do not allow user to select a value other than 1, 2, or3 from the menu

-declare all needed variables inside the class (globally inside) and out of all methods including main().

In: Computer Science

Create a form with two inputs name and roll number.And write a script to validate the...

Create a form with two inputs name and roll number.And write a script to validate the inputs.Any of them should not be empty.
Name will be string and roll number will be number between 1 -10 only

In: Computer Science

Assume s is a string of numbers. Write a program that prints the longest substring of...

Assume s is a string of numbers. Write a program that prints the longest substring of s in which the numbers occur in ascending order and compute the average of the numbers found. For example, if s = '561984235272145785310', then your program should print Longest substring in numeric ascending order is: 14578 Average: 5 In the case of ties, print the first substring. For example, if s = '147279', then your program should print Longest substring in numeric ascending order is: 147 Average: 4

I need python code for this one?

In: Computer Science

Develop a python program that will determine if a department store customer has exceeded the credit...

Develop a python program that will determine if a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available:

 Account number  Balance at the beginning of the month  Total of all items charged by this customer this month  Total of all credits applied to this customer’s account this month  Allowed credit limit

The program should input each of the facts, calculate the new balance (=beginning balance + charges – credits), and determine if the new balance exceeds the customer’s credit limit. For those customers who credit limit is exceeded, the program should display the customer’s account number, credit limit, new balance and the message “Credit limit exceeded”.

In: Computer Science

Using Java, Ask for the runner’s name Ask the runner to enter a floating point number...

Using Java,

  1. Ask for the runner’s name

  2. Ask the runner to enter a floating point number for the number of miles ran, like 3.6 or 9.5

  3. Then ask for the number of hours, minutes, and seconds it took to run

  4. Format the numbers with leading 0's if the pace is 8 minutes and 3 second, it should be 8:03 and for marathon time, if its 1 hour and 15 minutes and 9 seconds, it should be 1:15:09

  5. Please read through the whole thing, as the pace table example and fastest man time is listed below...

  • A marathon is 26.219 miles

  • Pace is how long it takes in minutes and seconds to run 1 mile.

Example Input:
What is your first name? // user enters Pheidippides
How far did you run today? 10.6 // user enters 10.6 miles

How long did it take? Hours: 1 // user enters 1 hours

Minutes: 34 // user enters 34 minutes

Seconds: 17 // user enters 17 seconds

Example Output:

Hi Pheidippides
Your pace is 8:53 (minutes: seconds)
At this rate your marathon time would be 3:53:12
Good luck with your training!

After your program tells the user what their pace is, your program will build a table showing the following columns. The pace table should start with the fastest man time which is Eliud Kipchoge with a pace of 4:37 and 2:01:04 and continue in 17 minute and 37 second intervals until you reach the marathon time of the user.

Example: (THE PACE TABLE EXAMPLE)

Pace Table
Pace Marathon
4:37 2:01:04 ←- Eliud Kipchoge
5:17 2:18:41
5:57 2:36:18
6:37 2:53:55
7:18 3:11:32
7:58 3:29:09
8:38 3:46:46
8:53 3:53:12 ← Pheidippides






HINTS

  • The table should start with the World Record pace and time which is 4:37, 2:01:04.

  • Then continues in 17 minute and 37 second intervals until you reach the marathon time of the user.

  • Use a static function to print the pace table, introduce a while loop.

  • For the first person it should call a printTable function

    • Example : printTable (pace, “<--- Eliud Kipchoge”)

    • The pace table continues until it reaches the user

    • printTable (myPace, name) something like that  

  • For the marathon and pace time, make sure the format has 0’s if the time is 9 seconds, it should be 09.

  • Use the printf statement for formatting output (“02d %f%s”)

In: Computer Science

Who are the five scientists who came up with the linear time selection algorithm? How many...

Who are the five scientists who came up with the linear time selection algorithm? How many of them are still alive? What is the title of their original paper? What basis did they have for thinking that a linear time algorithm existed for this problem?

In: Computer Science

The electricity accounts of residents in a very small rural community are calculated as follows: a....

The electricity accounts of residents in a very small rural community are calculated as follows: a. if 500 units or less are used the cost is 2 cents per unit; b. if more than 500, but not more than 1000 units are used, the cost is $10 for the first 500 units, and then 5 cents for every unit in excess of 500; c. if more than 1000 units are used, the cost is $35 for the first 1000 units plus 10 cents for every unit in excess of 1000; d. in addition, a basic service fee of $5 is charged, no matter how much electricity is used. The five residents use the following amounts (units) of electricity in a certain month: 200, 500, 700, 1000, and 1500. Write a program which uses logical vectors to calculate how much they must pay. Display the results in two columns: one for the electricity used in each case, and one for amount owed. (Answers: $9, $15, $25, $40, $90)

In: Computer Science

JAVA: Compute the average of a list of user-entered integers representing rolls of two dice. The...

JAVA:

Compute the average of a list of user-entered integers representing rolls of two dice. The list ends when 0 is entered. Integers must be in the range 2 to 12 (inclusive); integers outside the range don't contribute to the average. Output the average, and the number of valid and invalid integers (excluding the ending 0). If only 0 is entered, output 0. The output may be a floating-point value. Ex: If the user enters 8 12 13 0, the output is:

Average: 10
Valid: 2
Invalid: 1

Hints:

  • Use a while loop with expression (userInt != 0).

  • Read the user's input into userInt before the loop, and also at the end of the loop body.

  • In the loop body, use an if-else to distinguish integers in the range and integers outside the range.

  • For integers in the range, keep track of the sum, and number of integers. For integers outside the range, just keep track of the number.

  • Use a cast to get a floating-point output: (double) sum / num .

  • Whenever dividing, be sure to handle the case of the denominator being 0.

In: Computer Science

There are various selection structures that can be used in programming. What are the different relational...

There are various selection structures that can be used in programming. What are the different relational operators used in selection structures in the Python programming language? Also, explain what short-circuiting is with respect to compound conditional expressions in Python. Provide examples to support your response in addition to constructive feedback on the structures and circumstances posted by your peers. Provide at least one reference to support your findings.

In: Computer Science

Write a code in python to read in a file of spice like component and/or control...

Write a code in python to read in a file of spice like component and/or control data. break the data up into fields in a class object.

In: Computer Science

This problem is about query flooding in P2P networks. Here, we explore the reverse-path routing of...

This problem is about query flooding in P2P networks. Here, we explore the reverse-path routing of the QueryHit messages in Gnutella. Suppose that Alice issues a Query message. Furthermore, suppose that Bob receives the Query message (which may have been forwarded by several intermediate peers) and has a file that matches the query.

5.1. As we know when a peer has a matching file, it sends a QueryHit message along the reverse path of the corresponding Query message. An alternative design would be for Bob to establish a direct TCP connection with Alice and send the QueryHit message over this connection. What are the advantages and disadvantages of such an alternative design?

5.2 In the Gnutella protocol, when the peer Alice generates a Query message, it inserts a unique ID in the message’s MessageID field. When the peer Bob has a match, it generates a QueryHit message using the same MessageID as the Query message. Describe how peers can use the MessageID field and local routing tables to accomplish reverse-path routing.

5.3. An alternative approach, which does not use message identifiers, is as follows. When a query message reaches a peer, before forwarding the message, the peer augments the query message with its IP address. Describe how peers can use this mechanism to accomplish reverse-path routing.

In: Computer Science

JAVA Create an HourlyEmployee class that inherits from Employee and has two new instance variables: hours,...

JAVA Create an HourlyEmployee class that inherits from Employee and has two new instance variables: hours, which represents the hours worked, and wage, which represents the employee's pay per hour. (Both are doubles.) Create a constructor that takes the arguments first name, last name, social security number, hourly wage, and the number of hours worked. Also create accessors, mutators, an earnings method that returns the money earned by the employee this week, and a toString method that returns information about the employee in the form of a String. The setWage method should ensure that the wage is nonnegative, and the setHours method should ensure that the value of hours is between 0 and 168 (the number of hours in a week).

Create a Driver class with a main method that prompts the user to enter a first name, last name, social security number, hours, and wage for an employee. Then, the program should create an HourlyEmployee object and use its toString method to print information about it.

SAMPLE RUN #1: java Driver

Enter·first·name:Bobbi↵
Enter·last·name:Benton↵
Enter·social·security·number:765-42-0092↵
Enter·hours·worked:53↵
Enter·wage:15.8↵
hourly·employee:·Bobbi·Benton↵
social·security·number:·765-42-0092↵
hours:·53.0·↵
wage:·15.80·↵
earnings:·837.40↵

In: Computer Science