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
DedPeter [7]
3 years ago
10

Discuss what repetitions structures are, and how they differ from the vectorization approaches we have previously studied in the

course. Is one technique (i.e. vectorization approaches or approaches using repetition structures) better than the other? Does it depend on the circumstance, or on the programming language? If you use outside resources or ideas that are not your own to help make your case, be sure that they are properly cited in the citation style of your choice. Consider a program involving at least one for loop that could be used in your (intended) field or that could be of use to you as a student. This program should be distinct from any other program you have discussed in a discussion previously. First, in plain English, describe the program and how it works. If the program is especially complex, you may instead examine a smaller discernible section of the program for this discussion. Based on your plain English description of the program, share one or more code fragments that you write for this discussion post to illustrate the concept of at least one for loop in your program. If the program is especially complex, you may instead share a smaller discernible section of the program for this discussion, but be sure that the subset of the program includes at least one for loop.
Computers and Technology
1 answer:
gogolik [260]3 years ago
6 0

Repetition structures, or loops, are used when a program needs to repeatedly process one or more instructions until some condition is met, at which time the loop ends. Many programming tasks are repetitive, having little variation from one item to the next. Vectorized mathematical code appears more like the mathematical expressions found in textbooks, making the code easier to understand. That is the difference. Hope I could help you on Brainly.com!

You might be interested in
How is photography like jazz music?
Wewaii [24]
LIke jazz, photography has fallings that are being implied to the pictures such as the jazz music. These felling or as there commonly know as soul can make great music and even HD pictures in photography.
7 0
3 years ago
Given three variables, a, b, c, of type double that have already been declared and initialized, write a statement that prints ea
mihalych1998 [28]

Answer:

The statement is written in Java.

  1. System.out.printf("%.5f %.5f %.5f",a,b,c);

Explanation:

Presume that there are three variable a, b and c which have already been declared and initialized with 4.014268319, 14309, 0.00937608 respectively.

To print each of the value with 5 digits to the right of the decimal point, we can use printf() method. We create a format specifier %.5f which is a placeholder of a floating point value. The .5 will specify five digits to the right of the decimal point.

We just create three similar format specifiers ( one for variable a, b, and c, respectively) and include them into printf() method. This will print the output as follows:

4.01427 14309.00000 0.00938  

6 0
3 years ago
State three positive uses of the computer in the government sector​
WINSTONCH [101]

Well Here I got 4

1. Email Functions

2. Distributing Payments

3. Record Keeping

4. Direct Mail Promotions

<em>Have A great night!</em>

<em></em>

6 0
3 years ago
HOWDOYOUDOASPACE?<br><br><br><br> I can't figure out how to make a space on my computer?
e-lub [12.9K]
Depending on the type of keyboard, all spacebars are at the bottom middle of your keyboard and is the largest part of the keyboard.
6 0
3 years ago
Read 2 more answers
Remove gray from RGB Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers repres
sergejj [24]

Answer:  

Here is the C++ program:  

#include <iostream>   //to use input output functions    

using namespace std;   //to identify objects cin cout    

int main() {   //start of main method    

int red,green,blue,smallest;   //declare variables to store integer values of red,green, blue and to store the smallest value    

cout<<"Enter value for red: ";  //prompts user to enter value for red    

cin>>red;  //reads value for red from user    

cout<<"Enter value for green: ";  //prompts user to enter value for green  

cin>>green; //reads value for green from user    

cout<<"Enter value for blue: "; //prompts user to enter value for blue    

cin>>blue;   //reads value for blue from user    

//computes the smallest value  

if(red<green && red<blue) //if red value is less than green and blue values    

smallest=red;   //red is the smallest so assign value of red to smallest    

else if(green<blue)   //if green value is less than blue value    

smallest=green; //green is the smallest so assign value of green to smallest  

else //this means blue is the smallest    

smallest=blue;  //assign value of blue to smallest    

//removes gray part by subtracting smallest from rgb  

red=red-smallest; //subtract smallest from red    

green=green-smallest; //subtract smallest from green    

blue=blue-smallest; //subtract smallest from blue    

cout<<"red after removing gray part: "<<red<<endl;  //displays amount of red after removing gray    

cout<<"green after removing gray part: "<<green<<endl; //displays amount of green after removing gray  

cout<<"blue after removing gray part: "<<blue<<endl;  } //displays amount of blue after removing gray  

Explanation:  

I will explain the program using an example.    

Lets say user enter 130 as value for red, 50 for green and 130 for blue. So  

red = 130    

green = 50

blue = 130  

First if condition if(red<green && red<blue)   checks if value of red is less than green and blue. Since red=130 so this condition evaluate to false and the program moves to the else if part else if(green<blue) which checks if green is less than blue. This condition evaluates to true as green=50 and blue = 130 so green is less than blue. Hence the body of this else if executes which has the statement: smallest=green;  so the smallest it set to green value.    

smallest = 50    

Now the statement: red=red-smallest; becomes:    

red = 130 - 50    

red = 80    

the statement: green=green-smallest;  becomes:    

green = 50 - 50    

green = 0    

the statement: blue=blue-smallest; becomes:    

blue = 130 - 50    

blue = 80    

So the output of the entire program is:    

red after removing gray part: 80                                                                                                 green after removing gray part: 0                                                                                                blue after removing gray part: 80    

The screenshot of the program along with its output is attached.

5 0
2 years ago
Other questions:
  • Which of the following is a strength of fiscal policy?
    15·1 answer
  • What is the quickest option for adding internet images to a power point presentation
    7·1 answer
  • True or false? A medical assistant can check for available exam rooms and providers using an electronic scheduling system.
    8·1 answer
  • When a business is using methods that help it use its time and resources the best they can, what are they exercising?
    11·2 answers
  • It is possible to limit the search results to a range of publication dates.
    13·1 answer
  • An argument does not always have to be made in words. A piece of music
    12·1 answer
  • To quit, a user types 'q'. To continue, a user types any other key. Which expression evaluates to true if a user should continue
    7·1 answer
  • Where ....................... the books that you borrowed? *
    5·1 answer
  • This isn't really a question ,but a random fact about Fnaf William Aton
    7·2 answers
  • Why womt this code work????
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!