Questions
MATLAB Create a 2 × 3 matrix variable mat. Pass this matrix variable to each of...

MATLAB

Create a 2 × 3 matrix variable mat. Pass this matrix variable to each of the following functions and make sure you understand the result: flip, fliplr, flipud, and rot90. In how many different ways can you reshape it?

Note: (in addition to the functions listed, rotate the matrix 180 degrees clockwise)

In: Computer Science

C++ C++ Write a definition for a structure type for records for CDs. The record contains...

C++

C++

Write a definition for a structure type for records for CDs. The record contains price and total number of songs, . Part of the problem is appropriate choices of type and member names.Then declare two variables of this structure. Write a function called GetData use the structure as function argument to ask the user to input the value from the keyboard for structure variables.

In: Computer Science

Write a method speedingTicket() that decides whether a driver should be given a ticket from a...

Write a method speedingTicket() that decides whether a driver should be given a ticket from a police officer. The method accepts three parameters: speed (i.e., car speed) as integer; limit (i.e., speed limit) as integer and a boolean named donut indicating whether or not the police officer has eaten a donut today. A police officer that has eaten a donut is happy, so he/she is less likely to give the driver a ticket.

Your method should display either “Give Ticket” or “No Ticket!” based on the following:

• TICKET: Driver’s speed is more than 20 over the speed limit, regardless of donut status.

• TICKET: Driver's speed is 5-20 over the speed limit and officer has not eaten a donut.

• NO TICKET: Driver's speed is 5-20 over the speed limit and officer has eaten a donut.

• NO TICKET: Driver’s speed is < 5 over the speed limit, regardless of donut status.

Sample Calls Output speedingTicket(58, 55, false) No Ticket!

speedingTicket(45, 30, false) Give Ticket

speedingTicket(100, 75, true) Give Ticket

speedingTicket(42, 35, true) No Ticket!

speedingTicket(30, 35, false) No Ticket! //write your method below including the method header

In: Computer Science

7. In order to improve the network performance and security, ACLs is recommended. Please explain what...

7. In order to improve the network performance and security, ACLs is recommended. Please explain what is the ACL ?

8. How can ACLs help with the required tasks?

9. What are the principles of applying ACLs?

10. How to block VLAN 10 to visit ISP? Please write down the ACL statement(s) accordingly

In: Computer Science

Develop a Java program that determines the gross pay for an employee. The company pays hourly...

Develop a Java program that determines the gross pay for an employee. The company pays hourly rate for the first 40 hours worked by the employee and time and a half (1.5x hourly rate) for all hours worked in excess of 40. The user of your application will enter an employee name, shift (day or night) ,the number of hours worked for the week and their hourly rate. Your program should then calculate and display the employee’s name, regular pay, overtime pay, total gross pay and payperiod. PayPeriod is "Friday" for "day" shift and "Saturday" for "night" shift. Use class Scanner to input the data. Be sure to format output, so it is professionally displayed to your users.

Here is an example of pseudocode:


Start
Enter employee name
Enter employee shift (day/night)
Enter hours worked
Enter hourly pay rate
Calculate reg pay
if hours worked > 40 then
Calculate overtime pay
else
overtime = 0
Calculate total pay
Output employee name, reguldar pay, overtime pay, total pay
If day shift
output “Friday payperiod”
Else
output “Saturday payperiod”.
End.

In: Computer Science

this should be written in Java- Problem: Min/Max Search by Index Develop a program that, given...

this should be written in Java- Problem: Min/Max Search by Index Develop a program that, given a sequence S of integers as input, produces as output two sequences of positive integers, the first of which indicates all those positions in S at which S's minimum value occurs and the second of which indicates all those positions at which S's maximum value occurs. Positions are numbered starting at zero (0).

Facts ● Scanner has a method that returns a boolean indicating whether a next integer exists in its input stream ( hasNextInt() ) ● Scanner objects can be initialized to to scan String data as input.

Sample input

3

3 6 -1 4 6 5 3

0 0 0 0

-4 45 2 0 3 5 11 -7 854 25 3 -7 4 -3

Sample output

3 6 -1 4 6 5 3

2

1 4

0 0 0 0

0 1 2 3

0 1 2 3

-4 45 2 0 3 5 11 -7 854 25 3 -7 4 -3

7 11

8

Input The input will begin with a single line containing T , the number of test cases to follow. The remaining lines contain the T sequences, one line per sequence. Each of these lines contains the values in the sequence. Each such value is separated from the next by at least one space.

Output For each sequence given as input, there should be four lines of output. The first line echos the given sequence. The second line indicates the positions at which the minimum value occurs. The third line indicates the positions at which the maximum value occurs. The fourth line is blank.

In: Computer Science

Write a javascript program that computes the total cost for a five year car lease. The...

Write a javascript program that computes the total cost for a five year car lease. The program starts with a monthly leasing amount and a yearly increase in percent. The program then outputs the total amount paid for each year and the total overall cost of the lease.

In: Computer Science

What is your opinion on the use of AI technology? Is it necessary or is it...

What is your opinion on the use of AI technology? Is it necessary or is it a step in a wrong/different direction?

In: Computer Science

please i need to have good answers and easy to understand This exercise refers to the...

please i need to have good answers and easy to understand

This exercise refers to the Develop Schedule process. Please answer the following questions.

  1. Describe the difference between crashing and fast tracking.
  2. During Schedule Development, resources are assigned to the project activities. Describe resource leveling heuristics and why and when you use this technique.
  3. What are the advantages and disadvantages of using project management software?

In: Computer Science

In racket Assume that the elements of a list are indexed starting with 1. Write a...

In racket

Assume that the elements of a list are indexed starting with 1. Write a function alts that takes a list of integers xs and returns a pair of lists, the first of which has all the odd-indexed elements (in the same relative order as in xs) and the second of which has all the even-indexed elements (in the same relative order as in xs).

Output should be

(alts (list 7 5 4 6 9 2 8 3)) '((7 4 9 8)5 6 2 3)

(alts (list 5 4 6 9 2 8 3)) '((5 6 2 3) 4 9 8)

Any help would be appreciated, we're not allowed to use cond

In: Computer Science

• Using the Scanner class to obtain input from the user. • Using printf to output...

• Using the Scanner class to obtain input from the user. • Using printf to output information to the user. • Using arithmetic operators to perform calculations. • Using if statements to make decisions based on the truth or falsity of a condition. • Using relational operators to compare variable values. Project 1: Write an application that asks the user to enter two integers, obtains them from the user and prints their sum, product, difference and quotient (division). Sample Output: CSC 110 Lab 4 Page 1 of 3 Project 2. Write an application that asks the user to enter two integers, obtains them from the user and displays the larger number followed by the words “is larger”. If the numbers are equal, print the message “These numbers are equal”

In: Computer Science

Java. If possible please put explanations for each line of code. Write a test program that...

Java. If possible please put explanations for each line of code.

Write a test program that prompts the user to enter a series of integers and displays whether the series contains runLength consecutive same-valued elements. Your program’s main() must prompt the user to enter the input size - i.e., the number of values in the series, the number of consecutive same-valued elements to match, and the sequence of integer values to check. The return value indicates whether at least one run of runLength elements exists in values. Implement the test program as part of the NConsecutive class (the main() method is already in place at the end of the class).

Enter the number of values: 3
How many consecutive, same-valued elements should I look for? 3
Enter 3 numbers: 5 5 5
The list has at least one sequence of 3 consecutive same-valued elements
Enter the number of values: 3
How many consecutive, same-valued elements should I look for? 4
Enter 3 numbers: 5 5 5
The list has no sequences of 4 consecutive same-valued elements

In: Computer Science

C++: Write a program that produces truth tables for the following compound propositions. Write the header...

C++:

Write a program that produces truth tables for the following compound propositions. Write the header of the tables, including intermedial steps and the final result. There should be three tables. Output the result on the file prog2 output.txt.

1. p&!(p|q)

2. (p|q)&!(p&q)

3. (p–>q)<->(!q–>!p)

NOTE: Do not hard code truth tables. The program must use binary or bitwase operators to compute the results.

In: Computer Science

How were the original Internet requirements met through its design? What are the two main requirements...

How were the original Internet requirements met through its design? What are the two main requirements that you see missing from the original design that

are much needed today?

In: Computer Science

Enumerations Create an advanced enumeration to represent months (JANUARY – DECEMBER) called enuMonths Add internal properties...

Enumerations

  1. Create an advanced enumeration to represent months (JANUARY – DECEMBER) called enuMonths
    1. Add internal properties to represent a month.
      1. friendlyName                ( e.g., January, February, etc. )
      2. shortName                   ( e.g., Jan, Feb, etc. )
      3. monthNumber              ( e.g., 1, 2, etc. )
      4. daysInMonth                ( e.g., 31, 28, etc. )
      5. isLeapYearMonth          ( e.g., false, true, etc. )
  2. Create an advanced enumeration for a deck of cards in a game of blackjack called enuCards ( AH, 2H, 3H, etc… )
    1. Add the internal properties
      1. friendlyName                ( e.g., Ace of Hearts, 2 of Diamonds, etc. )
      2. minPointValue              ( e.g., 1, 2, etc. )
      3. maxPointValue             ( e.g., 11, 2, etc. )

  1. Create an advanced enumeration of your own. You can decide the subject and the properties it stores.  You can also add public methods to the enumeration that perform a task or calculation.

Interfaces

  1. Create an interface that would apply to all vending machines called iVendingMachine.  You will need to come up with the methods on your own that will be applied to anything that interfaces with the iVendingMachine interface
  2. Create an interface for an automobile called iAutomobile. This interface should cover what any automobile would need to implement.

In: Computer Science