Define the sentinel controlled loop

Assignment Help Data Structure & Algorithms
Reference no: EM131484542

Question: Task #1: Counter controlled loop

a). Write a program that will use a counter-controlled loop to display the first 50 numbers

b). Modify the program to prompt the user for a number. Starting with that number, use the counter controlled loop to display 50 numbers beginning with the number the user keyed in.

Task #2: Sentinel Controlled loop

Sentinel controlled loop with numbers

Modify the program to prompt the user to input a list of numbers. Display the number enter to the user .To end entering the list in the input the user must enter -1 as the sentinel value that will terminate the loop.
Sentinel controlled loop with strings

Modify the program to prompt the user to input a list of names. Display the name enter to the user .To end entering the list in the input the user must enter an * as the sentinel value that will terminate the loop.

Task #3: EOF controlled loop

Modify the program in task #1 to write on the first 50 numbers to a file name numbers.txt. Afterwards, open the file as an input-file and use the EOF to control your loop.Display the records read from the file to the screen.After the EOF returns the value of true, the loop will terminate.

Reference no: EM131484542

Questions Cloud

Explain level of success for the leaders identified : determine if there is a relationship between the level of success for the leaders identified and the incorporation of conscious capitalism by the leaders.
Marketing across digital channels : After reviewing the resources on Dunkin Donuts and its marketing across digital channels. What impact did that have on your relationship with that business?
Dna and rna-genes-mutations and gene therapies : Examine three (3) differences between DNA and RNA then explain two (2) main reasons why DNA is the most favorable molecule for genetic material.
A disadvantage of the? few suppliers sourcing strategy : A disadvantage of the? "few suppliers" sourcing strategy? is:
Define the sentinel controlled loop : Write a program that will use a counter-controlled loop to display the first 50 numbers.
Who are the stakeholders and affected constituencies : Who are the stakeholders and affected constituencies? What political institutions are relevant to the policy discussion about this issue?
Discuss your general opinion about the future of print media : Discuss your general opinion about the future of print media.
Sells four cases of stein beer each day : The manager of the Quick Stop Corner Convenience Store (which never closes) sells four cases of Stein beer each day.
Solve the problem using the selection sort : Write a program that will create an unsorted array with 10 integer elements. you may prompt the user for the elements or you may populate the elements.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write the key-sequenced insertion algorithm for general tree

Write the key-sequenced insertion algorithm for general trees.

  Find the coordinates of the optimal location of new machine

A machine shop has five machines, located at (3, 3), (3, 7), (8, 4), (12, 3), and (14, 6), respectively. A new machine is to be located in the shop.

  Threat model to describe risk of attack vector

Construct a simple threat model that describes the risk this represents: attacker(s), attack vector, vulnerability, assets, and likelihood of occurrence, likely impact, and plausible mitigations.

  Entity relationship diagrams

Discuss why are Entity Relationship Diagrams an important initial stage in developing databases? Who would be the initial parties interacting to develop the ERDs?

  How do a bubble sort in mips?

How do a bubble sort in MIPS?

  Show a schematic diagram of a priority queue

55-4793 Algorithms and Data Structures Assignment. Show a schematic diagram of a priority queue for the following "job elements". Note that the jobs are not in a particular order in this example. In your schematic diagram, clearly show the beginnin..

  Write a c++ program to find the intersection

Write a C++ program to find the intersection, A set is a collection of distinct entities regarded as a unit, being either individually specified or (more usually) satisfying specified conditions.

  Write down the algorithm to insert an item

Write down the sample code to create a Linked List and allocate storage space for a node Write down the algorithm to insert an item At the beginning of a linked list

  Write a java program that plays a two player dice game

Write a Java program that plays a two player dice game called Guts. If a player rolls a 1, then the turns ends and the player receives no points for that turn.

  Variables constants and data types

The following M.U.S.E. materials may help you with this assignment: Sequential Logic Structures and Variables, Constants, and Data Types

  Create a correct way of representing the state of the robot

A robot moves around in a confined space (shown in diagram below) which can be represented using a 10 X 10 grid of cells where the cells marked 'X' are unsurpassable walls (thus the diagram shows walls surrounding the space and also a wall inside ..

  Write pseudocode for a procedure random-search

Write pseudocode for a procedure RANDOM-SEARCH to implement the strategy above. Suppose that there is exactly one index i such that A[i] = x. What is the expected number of indices into A that we must pick before we find x and RANDOM-SEARCH termina..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd