Discuss why it is necessary to use repetitive statement, and use segment codes to demonstrate your understanding of repetitive statement. Explain why you are choosing one of the following three statements in your code. a) for/foreach statement b) while/until statement c) do while/do until statement. Provide examples. You are welcome to do your own research or/and give feedback on others' comments.
Repetitive statements are an Integral part of any programming language, as they allow you to use a certain piece of code again and again , where multiple iterations are required to be performed for a fixed no. Of times.
Writing repetitive statements allows you to perform the function until it satisfies the requirements set by the user.
There are several repetitive statements such as:
1. For
2. While
3. Do-while
There use and how and why they are used are given below.
For ( I=0; I<500; I++)
{ a= a+6;
}
This statement will keep performing the specified statement inside the for until it satisfies the condition of being less than 500.
It is used when we know the specific amount of time a iteration or function has to be performed .
2.
While( a<5)
{ I++;}
The statement will continue to execute till the value is less than 5, and exit as soon as it doesn't satisfy the condition.
It will execute only of the condition is satisfied. If not, it exits .
3. .
Do {
A= A++;
}
While (I<4)
{ A++; }
In the do-while statements, the conditions will execute at least once as specified under the do and then after one execution it will check for conditions under the while statement and proceed accordingly.
The do statements will execute at least once , irrespective of further statement.
Hope that helps .
Regards
Discuss why it is necessary to use repetitive statement, and use segment codes to demonstrate your...
What is the role of ethics within corporate governance? Why do corporations establish codes of ethics? Do you think they are effective? Why or why not? Should there be repercussions for failure to adhere to corporate ethics policy? Why or why not? Next, research the code of ethics for a company of your choosing. You can usually find this info on the company’s webpage, or with a simple Google search of “company x” and “code of ethics.” (Be sure to...
Marketing Segmentation & Targeting The Why Discuss the “Why” it is important for companies to segment markets. What is the rationale behind this? Specific Company Pick a company’s product/brand that you either like or are familiar with enough to know about their segmentation and targeting strategies. If you don't have a company that you are familiar with enough, pick one that you are familiar enough through the advertisements and general marketing you see them conducting. 1. Name the company/product/brand and...
Part 1: After reflecting on your program learning – and in your own words – write (2-3 paragraphs) about how you will demonstrate the following, within a professional environment. Include responses to the following topics within a professional environment: a. What is the importance of providing and receiving feedback from peers? b. How might you recognize peers’ skills, experience, creativity, and contributions? c. Why should you disagree tactfully? d. Why might you need to check for understanding while collaborating with...
In each question, be sure to support facts and give examples to demonstrate learning. In answering questions, you must define and explain the organizational behavior terms that you use. 1. You own and operate a hardware store in Maumelle, Arkansas. Following a major tornado in town, you see that there is a demand for generators. You have purchased the 200 in your shop over time for between $150 and $175, and you sell them for $250 each except for sales,...
This discussion asks you to compose and post a research proposal for your final project assignment, and offer feedback to others on their projects. Your Formal Research Proposal should consist of the following items: topic and medium of your project — will you be researching a workplace problem or innovation, identifying your specific topic of interest, and will you be presenting your findings in a traditional website or a blog intended audience — what kind of reader do you hope...
Knowing that firms change with the implementation of new IT applications, discuss why organizations sometimes resist changes in information systems. Include organizational factors to consider when planning a new system in your discussion. What role do you think management plays in organizational resistance to change? Do you think the role of management in systems development is important or not? Provide support for your answers. discuss professional codes of conduct by associations of professions such as the American Medical Association (AMA),...
Explain emotional intelligence in your own words, using examples from real life. Discuss why you think emotional intelligence is important in our personal and professional lives. Discuss some ways that one can enhance his or her emotional intelligence. Do you think some people are born with good EI abilities, or can EI can be taught? Explain the reasons for your choices.
Why are collaboration and teamwork important and why is it important that you can demonstrate these skills? Are collaboration and teamwork the same? Why is it difficult sometimes for teams to reach their potential and achieve their goals? To what extent do you believe that each team member is responsible for others’ success and failures? How important is the role of the manager in ensuring that teams function well? Explain why it is important that you develop effective teamwork and...
Please Help!!! Requirements: Use an external CSS & JS file, no internal or inline styles & scripts Please comment your JS to demonstrate your understanding of what is happening Create a form with at least 2 inputs and a submit button A good example would be First Name, Last Name, and Age. Use JS to provide the user with some feedback on the values they enter or choose with your inputs To do this you will need create a function...
1) In C++, come up with a scenario where you should use a catch(...). What should you do in that catch block? 2) Describe in detail any problems you see in the following code. void funcOne() { Dog *ptr = new Dog; cout << “Presenting the result of a division: “ << funcDivide(); delete ptr; } int funcDivide() { int a, b; cin >> a >> b; if (b == 0) throw “Divide...