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
worty [1.4K]
2 years ago
5

Which for loop syntax is correct?

Computers and Technology
1 answer:
Ugo [173]2 years ago
3 0

Answer:

C

Explanation:

You might be interested in
Write, compile, and test the MovieQuoteInfo class so that it displays your favorite movie quote, the movie it comes from, the ch
Irina18 [472]

Using the knowledge of computational language in JAVA it is possible to write a code that removes your favorite phrase from the movie. It consists of two classes in which one is driver code to test the MovieQuoteInfo class.

<h3>Writing code in JAVA:</h3>

<em>public class MovieQuoteInfo { //definition of MovieQuoteInfo class </em>

<em> //All the instance variables marked as private </em>

<em> private String quote;</em>

<em> private String saidBy;</em>

<em> private String movieName;</em>

<em> private int year;</em>

<em> public MovieQuoteInfo(String quote, String saidBy, String movieName, int year) { //parameterized constructor </em>

<em>  super();</em>

<em>  this.quote = quote;</em>

<em>  this.saidBy = saidBy;</em>

<em>  this.movieName = movieName;</em>

<em>  this.year = year;</em>

<em> }</em>

<em> //getters and setters </em>

<em> public String getQuote() {</em>

<em>  return quote;</em>

<em> }</em>

<em> public void setQuote(String quote) {</em>

<em>  this.quote = quote;</em>

<em> }</em>

<em> public String getSaidBy() {</em>

<em>  return saidBy;</em>

<em> }</em>

<em> public void setSaidBy(String saidBy) {</em>

<em>  this.saidBy = saidBy;</em>

<em> }</em>

<em> public String getMovieName() {</em>

<em>  return movieName;</em>

<em> }</em>

<em> public void setMovieName(String movieName) {</em>

<em>  this.movieName = movieName;</em>

<em> }</em>

<em> public int getYear() {</em>

<em>  return year;</em>

<em> }</em>

<em> public void setYear(int year) {</em>

<em>  this.year = year;</em>

<em> }</em>

<em> //overriden toString() to print the formatted data</em>

<em> public String toString() {</em>

<em>  String s = quote+",\n";</em>

<em>  s+="said by "+this.saidBy+"\n";</em>

<em>  s+="in the movie "+this.movieName+"\n";</em>

<em>  s+="in "+this.year+".";</em>

<em>  return s;</em>

<em> }</em>

<em>}</em>

<em>Driver.java</em>

<em>public class Driver { //driver code to test the MovieQuoteInfo class</em>

<em> public static void main(String[] args) {</em>

<em>  MovieQuoteInfo quote1 = new MovieQuoteInfo("Rosebud", "Charles Foster Kane", "Citizen Kane", 1941);//Create an object of MovieQuoteInfo class</em>

<em>  System.out.println(quote1); //print its details </em>

<em> }</em>

<em>}</em>

See more about JAVA at brainly.com/question/12975450

#SPJ1

7 0
2 years ago
In tableData the column variable of the first column should be RowerNames, the second RowingEvent, the third RowerWeight and the
maxonik [38]

Answer:

Required MatLab code is given below:

Explanation:

function tableData=CreateTable(Names, Event, Weight)

% Matlab function to create a table from the given input arrays

% Inputs:

% Names will be n x 1 string array,

% Event will be n x 1 string array,

% Weight will be n x 1 double column array.

% Outputs:

% tableData : where column variables are : RowerNames, RowingEvent,

% RowerWeight and WeightCategories

WeightCategories = ""; % create an empty WeightCategories array

% loop over the Weight column array, populate the WeightCategories

% based on Weight

for i=1:length(Weight)

if(Weight(i) >= 100 && Weight(i) < 150)

WeightCategories(i) = "light weight";

elseif(Weight(i) >= 150 && Weight(i) < 200)

WeightCategories(i) = "medium weight";

else

WeightCategories(i) = "heavy weight";

end

end

% create the table with arrays Names, Events, Weight and

% WeightCategories by taking transpose of WeightCategories as WeightCategories is a row array

tableData = table(Names,Event,Weight,WeightCategories','VariableNames',{'RowerNames','RowingEvent','RowerWeight','WeightCategories'});

end

%end of function

8 0
4 years ago
When a CPU executes each instruction in a program, it uses a process known as the __________.
lapo4ka [179]

Answer:

The answer is "fetch-decode-execute cycle"

Explanation:

The FDE cycle stands for Fetch-Decode-Execute cycle, It is a computing operation, in which a CPU process, to retrieves the system in its order memory form, it also decides that what instruction is supposed to do, and executes certain activities.  In this process, the operating system loads the files and the program on a disc to the main memory (RAM).

8 0
4 years ago
What is the value of the cost variable after the following code snippet is executed? int cost = 82; if (cost &lt; 100) { cost =
KonstantinChe [14]

Answer:

184

Explanation:

Given the codes

  1.        int cost = 82;
  2.        if (cost < 100)
  3.        {
  4.            cost = cost + 10;
  5.        }
  6.        if (cost > 50)
  7.        {
  8.            cost = cost * 2;
  9.        }
  10.        if (cost < 100)
  11.        {
  12.            cost = cost - 20;
  13.        }

The initial value of cost is 82.

The if condition in Line 3 will pass and therefore cost = 82 + 10 = 92

The if condition in Line 8 will pass and therefore cost = 92 * 2 = 184

The if condition in Line 13 will fail l and therefore the if block will be skipped.

At last, the we get cost = 184.

8 0
3 years ago
Which similar computer network components connect multiple devices?
Firlakuza [10]
That computer network component is router. It's possible to connect printer to it. Other computer and any other devices.
8 0
4 years ago
Other questions:
  • In the context of the planning phase of the systems development life cycle (SDLC), which is an example of an internally identifi
    6·1 answer
  • Students who respond promptly to e-mails are following which netiquette rule?
    13·2 answers
  • Advantages of heading attributes
    5·1 answer
  • Holly has at most $828 to spend for moving from her old apartment. The moving company charges $80 per hour plus at rate of $300.
    9·1 answer
  • Spreadsheet software can be used to do all the following except _____.
    5·2 answers
  • What is a common citation style used by students for English classes?
    5·1 answer
  • Turns on her laptop and gets the error message "OS NOT FOUND." She checks the hard disk for damage or loose cable, but that is n
    11·1 answer
  • PLZ PLZ PLZ PLZ HELP I ONLY HAVE 5 MINUTES IT SAYS THE SUBJECT IS COMPUTERS AND TECHNOLOGY BUT ITS ACTUALLY MEDIA LIT
    5·1 answer
  • Who is considered as the father of computer science?​
    11·1 answer
  • __________ is a software-enabled technique that can change the hardcoded mac address to any mac address and thus overcome mac ad
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!