1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aliya0001 [1]
2 years ago
15

The counter in a for or while loop can have an explicit increment: for i=m:k:n. This advances the counter i by increment k each

time. In this problem we will evaluate the product of the first 9 even numbers 2·4·6·...·18 in two ways: (a) Write a script file that evaluates the product of the first 9 even numbers using a for loop.(b) Evaluate the product of the first 9 even numbers using a single MATLAB command. Use the MATLAB command prod.
Computers and Technology
1 answer:
Novosadov [1.4K]2 years ago
3 0

Answer:

(b) prod(2:2:18)

Explanation:

(a) Evaluate the product of the first 9 even numbers:

answer = 1;

for even = 2:2:18

    answer = answer*even;

disp(answer)

(b) Evaluate the product of the first 9 even numbers using MATLAB prod() function

answer = prod(2:2:18)

disp(answer)

You might be interested in
Which of the following sentences is accurate? a. PDF stands for "Proofreading Direct Files." b. PDF files cannot be edited. c. B
olga_2 [115]

Answer: Option (c) is correct

Explanation:

PDF is portable document format that come in form of file format .It is used for sharing and transmitting between computing and operating systems for viewing and printing in actual page layout. They can be used fro eBooks ,scanned document and text etc.

  • Other options are incorrect because not all business organization use PDF, PDF has the capability of being edited and it stands for "portable document format".
  • Thus, the correct option is option(c)
8 0
3 years ago
Classify the functions of dhcp and dns protocols​
Yuki888 [10]

Answer:

Dynamic Host Configuration Protocol (DHCP) enables users to dynamically and transparently assign reusable IP addresses to clients. ... Domain Name System (DNS) is the system in the Internet that maps names of objects (usually host names) into IP numbers or other resource record values.

8 0
3 years ago
Write a program that prompts the user to enter two characters and display the corresponding major and year status. The first cha
nydimaria [60]

Answer:

  1. import java.util.Scanner;  
  2. public class Main {
  3.    public static void main(String[] args) {
  4.        Scanner input = new Scanner(System.in);
  5.        System.out.print("Please enter two characters: ");
  6.        String inputStr = input.nextLine();
  7.        if(inputStr.charAt(0) == 'B' || inputStr.charAt(0) == 'b'){
  8.            System.out.println("Biology");
  9.        }
  10.        else if(inputStr.charAt(0) == 'C' || inputStr.charAt(0)== 'c'){
  11.            System.out.println("Computer Science");
  12.        }
  13.        else if(inputStr.charAt(0) == 'I' || inputStr.charAt(0) == 'i')
  14.        {
  15.            System.out.println("Information Technology and Systems");
  16.        }
  17.        else{
  18.            System.out.println("Invalid major");
  19.        }
  20.        int num = Character.getNumericValue(inputStr.charAt(1));
  21.        if(num >= 1 && num <= 4){
  22.            switch (num){
  23.                case 1:
  24.                    System.out.println("freshman");
  25.                    break;
  26.                case 2:
  27.                    System.out.println("sophomore");
  28.                    break;
  29.                case 3:
  30.                    System.out.println("junior");
  31.                    break;
  32.                case 4:
  33.                    System.out.println("senior");
  34.                    break;
  35.            }
  36.        }
  37.        else{
  38.            System.out.println("Invalid year status");
  39.        }
  40.    }
  41. }

Explanation:

The code consists of two main parts. The part 1 is to validate the input major and print out the major according to the input character (Line 10 -22). If the input character is not matched with the target letters, a message invalid major will be displayed.

The part 2 is to validate the year status to make sure it only fall within the range of 1-4  (Line 26 -45). If within the range, the program will display the year major accordingly. If not a message invalid year status will be displayed.

4 0
3 years ago
Antivirus software products require that you update _____ on a regular basis
german
Operating System, as far as I know @[email protected]
5 0
3 years ago
Read 2 more answers
Sharing resources.
olya-2409 [2.1K]

Answer:

Explanation:

2- Multitasking Multitasking – Multitasking Multitasking is one among the main advantage of computer. ...

Speed – Now computer isn't just a calculating device. ...

Cost/ Stores huge – Amount of knowledge it's a coffee cost solution. ...

Accuracy – ...

Data Security – ...

Task completer – ...

Communication – ...

Productivity –

More items...•

6 0
2 years ago
Other questions:
  • Explain the components of Information System?​
    13·1 answer
  • Sierra owns a small business and handles many responsibilities, from logistics to marketing. She's seen a lot of success with Go
    11·1 answer
  • Lexi wants to buy a $300 painting. when she gets to the store, she finds that it is on sale for 40% off. how much does Lexi spen
    10·1 answer
  • Introduction to Identity and Fitting In
    7·1 answer
  • Which of the following operation is not performed by a mouse 1) left click , middle click , right click, double click​
    15·2 answers
  • AJ created a list, and he needs all of the numbers to be in order. Which Python function will allow him to organize his list num
    5·2 answers
  • Which file is usually the first file to be displayed when you navigate to a website?
    5·1 answer
  • What are some things you think are worthwhile and are willing to work harder to accomplish? Check all that apply.
    5·1 answer
  • ______________ are used to store information that will be referenced and manipulated in a computer program. They label data with
    6·1 answer
  • A time stamp indicates the date and time that a measurement was taken. A data scientist has a list containing 10,000 time stamps
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!