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
balu736 [363]
3 years ago
15

How many times would the following loop iterate?

Computers and Technology
1 answer:
masha68 [24]3 years ago
5 0

Answer:

The answer to this question is given below in the explanation section

Explanation:

The code is :

Set k = 1

While k < 5

Display k

Set k = k + 1

End While

this is a while loop, that will iterate 4 times and display the body of loop.  and at the fifth iteration, the loop condition does not meet the condition and the loop will get terminated.

You might be interested in
Create two classes. The first, named Sale, holds data for a sales transaction. Its private data members include the day of the m
olya-2409 [2.1K]

Answer:

A C++ program was used in creating two classes. the code is stated below.

Explanation:

Solution

The C++ program is executed below:

#include<iostream>

using namespace std;

//declare class (will be define later)

class Salesperson;

//class Sale

class Sale

{

  //private members of class

  private:

      string day;

      double amtOfSale;

      int salesPersonId;

 //public methods

  public:

      //constructor that takes day,amount of sale and salesPersonId as parameters

      Sale(string date,double sale,int id)

      {

          //set the private members to the initial values passed

          day=date;

          amtOfSale=sale;

          salesPersonId=id;

      }    

      //declare a friend function that takes objects of the two classes as parameters

      friend void display(Sale,Salesperson);

};  

//define class Salesperson

class Salesperson

{

  //private members of the class

  private:

      int salesPersonId;

      string lastName;    

  //public methods

  public:

      //constructor that takes name and id as parameters

      Salesperson(int id,string name)

      {

          //set the members of the class with the parameters passed

          salesPersonId=id;

          lastName=name;

      }  

      //declare a friend function that takes objects of the two classes as parameters

      friend void display(Sale,Salesperson);

};

//define the friend funtion

void display(Sale saleObj,Salesperson personObj)

{

  //display the sales info using the objects of the two classes

  cout<<"\nSale #"<<saleObj.salesPersonId<<" on "<<saleObj.day<<" for $"<<saleObj.amtOfSale<<" sold by #"<<personObj.salesPersonId<<" "<<personObj.lastName;

}  

int main()

{

  //create object for Sale class and pass default values

  Sale sObj1("12/25/2016",559.95,103);

  //create object for Salesperson class and pass default values

  Salesperson pObj1(103,"Woods");

 

  //create another object for Sale class and pass default values

  Sale sObj2("11/15/2016",359.95,106);

  //create another object for Salesperson class and pass default values

  Salesperson pObj2(106,"Hansen");

  //using the friend function dislay the sales info

  display(sObj1,pObj1);

  display(sObj2,pObj2);

  return 0;

}

4 0
3 years ago
Whats the next lyric,i baked you a pie,pie,pie
eduard
“oh boy what flavor”
4 0
3 years ago
Read 2 more answers
What command would you use to copy the content of a file named report1 to another called report1uc. Convert the content of repor
Ray Of Light [21]

Answer:

Answered below.

Explanation:

This answer is applicable to Linux.

There are several commands for copying files in Linux. cp and rsync are the most widely used. cp though, is the command used to copy files and their contents.

To copy a file named report1.txt to another file named report1uc.txt in the current directory, the following command is run.

$ cp report1.txt report1uc.txt

You can change the case of the strings in the file by using the tr command.

tr [:lower:] [:upper:]

For example,

$ echo brainly | tr [:lower:]. [:upper:]

Result is BRAINLY.

7 0
3 years ago
What is the purpose of a report?
Tanzania [10]
C to organize data in a table
4 0
3 years ago
What is a trojan horse in computer science?
Firdavs [7]

Answer:

type of malware that is often disguised as legitimate software. Trojans can be employed by cyber-thieves and hackers trying to gain access to users' systems. Users are typically tricked by some form of social engineering into loading and executing Trojans on their systems.

Explanation its malware

4 0
2 years ago
Other questions:
  • How do you take a screenshot on an iPhone?
    8·2 answers
  • Each entry in a linked list is called a_______
    11·1 answer
  • Analyze the problem statement. Select the correct answer. Vision: We want to decrease errors in our billings to clients. Issue:
    5·1 answer
  • Think about some of the most memorable and forgettable games ever created. They can be games that were
    15·1 answer
  • Even if you cannot afford it you should donate at least 5 of your earnings to charity true or false
    8·1 answer
  • What tool can help discover and report computer errors when you first turn on a computer and before the operating system is laun
    9·2 answers
  • Using pointers and shared memory for IPC, what would you need to add to your code to ensure data integrity?
    15·1 answer
  • You were just hired as an IT Specialist for Smalltown School District. Your first assignment is to review a problem area&amp; in
    11·1 answer
  • Primary memory consists of the various devices that are able to store data and programs even when the power is off. true or fals
    11·1 answer
  • Instructions
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!