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
Ivahew [28]
4 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]4 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
What is the<br><br> stored program concept?
marin [14]

Answer:

 The stored program concept is defined as, in the architecture of computer where computer acts as internal store instruction and it is important because has high flexibility and user does not required to execute the instruction again and again. It is basically works on the principle of Von neumann architecture, as in which the instruction and the data are both same logically and can be used to store in the memory.

3 0
3 years ago
What font is the declaration of independence?
Keith_Richards [23]
I believe it is old English text
4 0
4 years ago
Are lenovo margins expected to be stable in the china operations
lisov135 [29]

Yes

Lenovo Group Limited is the world’s number 3 PC brand. It has gained the operating margins at the perfect levels. Lenovo has attained this steady growth and it expects to maintain or improve its gross margin in China operations now and in the future.

3 0
4 years ago
Read 2 more answers
Which set of technologies that support knowledge management is characterized by mashups, blogs, social networks, and wikis? a. X
Neporo4naja [7]

Answer: c) Web 2.0

Explanation:

Web 2.0 is the technology that consist applications and websites for the people to interact and sharing information, activities, event and other materials through social media components like blog, social networking sites,wikis, podcast etc.

  • Other options are incorrect because artificial intelligence, ERP(Enterprise resource planning) and XML(Extensible Markup Language) are not the tools that is used by users for interaction and communicating with the help of social media components.
  • Thus, the correct option is option(c).
3 0
3 years ago
Explain what LIFO and FIFO mean, and how they are used in Abstract data types?
Dimas [21]

Answer:

LIFO stands for Last In First Out. This procedure is used in the Stacks in data structures.Stacks are the data types in which the data is stored called Stack.

Explanation:

8 0
3 years ago
Other questions:
  • Which option enables you to keep the last grammatical change
    15·2 answers
  • Sukant’s professor asks her to take over his online class while he is away because she is an effective digital communicator. Whi
    11·2 answers
  • Your organization's network has multiple layers of security devices. When you attempt to connect to a service on the Internet. H
    9·1 answer
  • Algorithmic Complexity: what is the asymptotic complexity (Big-O) of each code section? Identify the critical section of each.\
    8·1 answer
  • What technology habit you practice every day that you need to stop to be more successful?
    13·1 answer
  • A company has four departments: A, B, C, and D. The number of IP addresses required by each department is 100, 60, 20, and 26 re
    5·1 answer
  • Elliott is trying to normalize a database that he has designed. Which is not one of the elements of 1NF or 2NF?
    15·1 answer
  • What should be taken into consideration when determining which critical information should be protected?
    11·1 answer
  • Text to appear
    12·1 answer
  • The specialized programs used by the operating systems to help ensure that memory is used properly and there are no memory confl
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!