
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Fill in the blanks
![using System;
C:\Users\ferdy\source\repos\ParseTemperature\bin\Debug\ParseT
2
Enamespace ParseTemperature
Pls. enter temperature: abc
4
non-numeric entries
are trapped here
Oreferences
class Program
Pls. enter temperature: #temp
6
1 reference
static double ParseInput(string prompt)
Pls. enter temperature: 1
Valid temperature: 1.00
correct value is
validated
9
double Oval;
// input loop & validation
do () while (!(double. TryParse(Prompt (prompt), out Oval)));
return Oval;
>> Try again (Y/N) ? y
another trial input
10
11
Pls. enter temperature: e
INVALID temperature!
O is trapped as
inavalid
12
13
2 references
static string Prompt (string promptTxt)
>> Try again (Y/N) ? y
another trial input
14
15
Console.krite(promptTxt);
string outTxt - Console.Readline(O;
return outTxt;
16
Pls. enter temperature: -1
INVALID temperature!
negative value is
trapped
17
18
19
>> Try again (Y/N) ? n
program terminates
20
static void Main(string[] args)
21
22
double temp;
// loop for several entries
23
24
do
25
")3B
26
temp - ParseInput("\n.
if (temp <= 0) Console.Writeline("
27
28
else Console.Writeline("Valid temperature: (0:f2)",
29
} while (Prompt("\n>> Try again (Y/N) ? "). ToLower () --
); // prompt to try again
30
31
Console.ReadKey(); // pause & terminate progran
32
33
34](https://content.bartleby.com/qna-images/question/a9f0b40c-ecf2-48f1-96c7-e64ee41f3c89/a8800296-ed4a-4292-b307-c0bd5e8c2d8f/3ivu2t_thumbnail.png)
Transcribed Image Text:using System;
C:\Users\ferdy\source\repos\ParseTemperature\bin\Debug\ParseT
2
Enamespace ParseTemperature
Pls. enter temperature: abc
4
non-numeric entries
are trapped here
Oreferences
class Program
Pls. enter temperature: #temp
6
1 reference
static double ParseInput(string prompt)
Pls. enter temperature: 1
Valid temperature: 1.00
correct value is
validated
9
double Oval;
// input loop & validation
do () while (!(double. TryParse(Prompt (prompt), out Oval)));
return Oval;
>> Try again (Y/N) ? y
another trial input
10
11
Pls. enter temperature: e
INVALID temperature!
O is trapped as
inavalid
12
13
2 references
static string Prompt (string promptTxt)
>> Try again (Y/N) ? y
another trial input
14
15
Console.krite(promptTxt);
string outTxt - Console.Readline(O;
return outTxt;
16
Pls. enter temperature: -1
INVALID temperature!
negative value is
trapped
17
18
19
>> Try again (Y/N) ? n
program terminates
20
static void Main(string[] args)
21
22
double temp;
// loop for several entries
23
24
do
25
")3B
26
temp - ParseInput("\n.
if (temp <= 0) Console.Writeline("
27
28
else Console.Writeline("Valid temperature: (0:f2)",
29
} while (Prompt("\n>> Try again (Y/N) ? "). ToLower () --
); // prompt to try again
30
31
Console.ReadKey(); // pause & terminate progran
32
33
34
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- Coin Toss, v.2.0 Purpose. Learn how to use count-controlled loops. Requirements. Rewrite your coinTossl.cpp from exercise 6.5 as coinToss2.cpp. Modify the program to allow the user to specify (via keyboard data entry) the number of coin tosses to perform. When you run the program, and it should say the result of each coin toss (that is, "Heads" or "Tails"). Supplemental. Read about "randomizing" in www.rdb3.com/cpp/exercises/Gaming.supplemental.pdf. Algorithm. Call srand Prompt the user to enter how many coin tosses to perform Input and store the user's selection Create a counter and set it to zero Start the loop here If the counter equals the number of tosses to perform Break from the loop Get and store a randomly-generated number in the range 0 to 1 If the randomly-generated number equals 0 Output "heads" If the randomly-generated number equals 1 Output "tails" Add one to the counter Loop back from here Example. with user input in blue Enter the number of tosses to perform: 3 Heads…arrow_forwardWhat are three things you may do if you've exhausted the debugging procedure without success?arrow_forwardWhat are three options you have if you still can't solve the issue after using the debugging process?arrow_forward
- Where does the term "deppresion" fit in?arrow_forward3- Give an example of an infinite loop (python)arrow_forwardWhich of the following statements about debugging is NOT correct?: A -In some ways debugging is like detective work. You are confronted with clues and you have to infer the processes and events that led to the results you see. B -Once you have an idea about what is going wrong, you must delete your program and completely rewrite all of the code all over again. C -For some people, programming and debugging are the same thing. That is, programming is the process of gradually debugging a program until it does what you want. D -Although it can be frustrating, debugging is one of the most intellectually rich, challenging, and interesting parts of programming.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY