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
Tema [17]
3 years ago
12

Write programs with loops that compute:

Computers and Technology
1 answer:
Katarina [22]3 years ago
6 0

Answer:

The programs are written in MATLAB.

(a)

sum = 0;

for i = 2:100  %This for loop starts from 2 and ends at 100

   sum = sum + i;  %This line sums each values of the loop

end

disp(sum); %This command displays the sum at command window

(b)

sum = 0;

for i = 2:100

   sum = sum + i^2;  %This line sums the squares of each values in the loop

end

disp(sum);

(c)

sum = 0;

a = input('Please enter a: ');

b = input('Please enter b: ');

for i = a:b

   if mod(i,2) == 1  %This command checks whether the value in the loop is odd or not

       sum = sum + i;  %This command sums each odd value in the loop

   end

end

(d)

seq = input('Please enter a few numbers with square brackets [] around them: ');

small = seq(1);  %Initialize small

large = seq(1);  % Initialize large

for i = 1:length(seq)  %Iterate over the sequence

   if seq(i) < small

       small = seq(i);  %Decide if the value in the loop is smallest

   elseif seq(i) > large

       large = seq(i);  %Decide if the value in the loop is largest

   end

end

fprintf('The smallest of the inputs is %g,\nThe largest of the inputs is %g.\n',small,large);

You might be interested in
A group of small local businesses have joined together to share access to a cloud-based payment system. Which type of cloud is m
Valentin [98]

The type of cloud that is most likely being implemented when a group of small local businesses has joined together to share access is community cloud service. The correct option is C.

<h3>What is cloud service?</h3>

Cloud services have a wide variety of services for companies and businesses. They provide applications and software with resources. They provide easy and affordable services.

Community cloud service is a shared type of cloud service that helps banks and heads of trading firms.

Thus, the correct option is C. Community.

To learn more about cloud service, refer to the below link:

brainly.com/question/24227961

#SPJ1

The question is incomplete. Your most probably complete question is given below:

Public

Private

Community

Hybrid

6 0
2 years ago
Why we can't install a 64 bit software on a 32 bit computer??
anastassius [24]
32 bit machines have less memory (ram) bandwidth
4 0
4 years ago
The MIQ inventory measures how much you value status. What are measures of status?
Alina [70]
When we're taking about measures of status, we're talking about either a socioeconomic perspective or something else. When we're talking about a socioeconomic perspective of status, there are two important measures. One would be social standing of a person and the other would be his economic standing. 
3 0
4 years ago
Mention at least five devices used for digitizing data
creativ13 [48]
Answer:
1. Cloud Storage Solutions
2. Digital Communication Tools
3. Cloud ERP Systems
4. CRM Platforms
5. Digital Accounting Tools

For more information, please visit: https://www.gend.co/blog/the-digitisation-tools-with-the-biggest-impact-for-business?hs_amp=true

Hope this helps!!
3 0
2 years ago
How do you autofit a column to fit the longest word in Microsoft Word?
sergey [27]

Adjust the table size, column width, or row height manually or automatically. You can change the size of multiple columns or rows and modify the space between cells. If you need to add a table to your Word document.

i hope its right!!!!


5 0
4 years ago
Read 2 more answers
Other questions:
  • Write a program that determines the price of a movie ticket (similar to the one in the chapter). The program asks for the custom
    9·1 answer
  • Write down the pseudo code of a program that calculates the Body Mass Index (BMI) of
    9·1 answer
  • How does is make you feel when you're kind to others? What are some opportunities in your life to be more kind to your friends a
    9·1 answer
  • The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is st
    8·1 answer
  • What symbol shows autocorrect is in use in access? WILL MARK BRAINLIEST FOR WHOEVER ANSWERS FIRST!!!
    5·1 answer
  • According the SDLC phases, which among these activities see a substantial amount of automation initiatives?
    12·2 answers
  • What is the action take to the input called?
    15·1 answer
  • . 。 • ゚ 。 .
    10·2 answers
  • Heyyyyyy<br> byeeeeeeeeeeeeeeeeeeeeeee
    15·2 answers
  • An Accenture healthcare client is interested in implementing an Artificial Intelligence (AI) solution to improve patient care, b
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!