answer.
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
Ivahew [28]
2 years ago
7

Write a loop that reads strings from standard input, where the string is either duck or goose. the loop terminates when goose is

read in. after the loop, your code should print out the number of duck strings that were read.
Computers and Technology
1 answer:
Misha Larkins [42]2 years ago
4 0
Have in mind that the following code is ofr C++ but I know that whatever the language you are using, you can use the same idea:

<span><iostream> 
using namespace std; 
int main() 
{ 
int count=0; 
string x; 
while(1) 
{ 
cout<<"Enter either goose or duck"; 
cin>>x; 
if ( x=="Goose") break; 
count++; 
} 

cout<<"Number of Ducks="<<count<<endl; 
return 0; 
}
</span>
Another one that is simplier but the language is python is:
counter = 0while True:  line = input()if line == 'duck':  counter += 1    elif line == 'goose':breakprint(counter)
You might be interested in
John works for Internal Computer Specialists, which focuses on helping small business owners resolve MIS infrastructure issues.
lisov135 [29]

Answer:

Hardware.

Explanation:

All electronics devices like computer servers, DVDs, smartphones and cell phones, wrist watches etc, comes with two main components, they are hardware and software.

The hardware components are the physical part of the device, while the software component is the written instructions configured to the hardware for executing tasks.

Cleaning the motherboard in a computer system, fixing a DVD, servicing other internal components of devices are all hardware maintenance and repair services.

6 0
2 years ago
Constantine forms the following hypothesis. Let n be any non-negative number that meets the following condition: when n is divid
notka56 [123]

Answer:

n=5

Explanation:

if n= 5

i.     n/5=5/5=1  so it divides completely the remainder is 0

ii.  97 - 6(5) = 97 - 30 = 67,   67 is a prime number.

8 0
2 years ago
Supplemental security software (such as anti-virus [anti-malware]) is: Generally considered essential for all desktops and lapto
k0ka [10]

Answer:

Explanation:

With an anti-virus, we can search, detect, and delete malware like spyware, worms, Trojans, rootkits, pseudoviruses, etc.

An anti-virus can detect virus with several methods like:

  • Digital signature
  • Heuristic detection
  • Behavior detection
  • Sandbox detection

Is necessary for personal laptops and desktops, even in companies hardware.

7 0
2 years ago
Assume that processor refers to an object that provides a void method named process that takes no arguments. As it happens, the
Gnom [1K]

Answer:

Following are the code in the Java Programming Language:

try{  //try block.

processor.process();  // call the function through the object.

}

catch(Exception e){  //catch block .

System.out.println( "process failure");   //if any exception occurs then print.

}

Explanation:

In the following code, we set two blocks in Java Programming Language of the exception handling which is try block or catch block.

  • In try block we call the function "process()" through the "processor" object.
  • If any exception occurs in the program then the catch block print the following message is "process failure"
6 0
1 year ago
Ruby is creating a presentation. She wants each slide displayed at intervals of five seconds. Which feature in the presentation
andrew-mc [135]

i believe its transition

6 0
2 years ago
Read 2 more answers
Other questions:
  • how do you make a circuit so 1 switch will turn on/off all the lights(3 lights) and a second switch will change the lights from
    14·2 answers
  • Jeff wants to be an archeologist. He found the information below and wants to properly cite it for his own use. The information
    15·2 answers
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • You are consulting for a trucking company that does a large amount ofbusiness shipping packages between New York and Boston. The
    5·1 answer
  • In your own words, describe what Internet Protocols are. Why is it important to have agreed upon protocols?
    6·1 answer
  • The maximum number of times the decrease key operation performed in Dijkstra's algorithm will be equal to ___________
    14·1 answer
  • Which of these are characteristics of a Python data type? Check all that apply.
    11·1 answer
  • Which of the following statements is true regarding input and output?
    12·2 answers
  • Which group contains the command to manually conduct a spell check ?
    9·1 answer
  • TQ Artificial Intelligence (AI)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!