Fill in the blanks

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
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
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
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY