Starting Out With Visual C# (5th Edition)
5th Edition
ISBN: 9780135183519
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 5.3, Problem 5.9CP
What messages will the following code sample display?
int number = 5;
number++;
MessageBox.Show(number.ToString());
number--;
MessageBox.Show(number.ToString());
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Javascript , Web Development
user_tickets = int(input())if user_tickets< 5:num_tickets=1else:num_tickets= user_ticketsprint('Value of num_tickets:', num_tickets)
CHALLENGE 8.19.4: Rearrange the lines to compute the total score for a single student.
ACTIVITY
504702.3407966.qx3zqy7
Consider a comma-separated file that contains student names and scores such as the following:
Jane Lee, 100, 98, 97, 100
Aaron X. Schmidt, 37, 42, 49, 54
Frank von Tardy, 2, 3, 10, 7
We can read the file one line at a time and use an istringstream object to process the scores. To get the position of the first
comma, simply read words from the input stream until the word ends with a comma. Then, read and sum the numbers remaining
on the line. Use get to remove the commas following each number.
Rearrange the lines below to compute the total score for a single student. Assume that each student has at least one score.
How to use this tool
Unused
while (getline (in_file, line))
{
}
char ch;
in.get (ch);
{
}
while (word [word.size() - 1] != ',')
total = 0;
while (in >> score)
istringstream in;
total = total + score;
in >> word;
main.cpp
#include
#include
#include
using…
Chapter 5 Solutions
Starting Out With Visual C# (5th Edition)
Ch. 5.1 - Prob. 5.1CPCh. 5.1 - Prob. 5.2CPCh. 5.1 - Prob. 5.3CPCh. 5.2 - What is a loop iteration?Ch. 5.2 - What is a counter variable?Ch. 5.2 - What is a pretest loop?Ch. 5.2 - Does the while loop rest its condition before or...Ch. 5.2 - What is an infinite loop?Ch. 5.3 - What messages will the following code sample...Ch. 5.3 - How many rimes will the following loop iterate?...
Ch. 5.4 - Name the three expressions that appear inside the...Ch. 5.4 - You want to write a for loop that displays I love...Ch. 5.4 - What would the following code display? for (int...Ch. 5.4 - What would the following code display? for (int...Ch. 5.5 - What is a posttest loop?Ch. 5.5 - What is the difference between the while loop and...Ch. 5.5 - How many times will the following loop iterate?...Ch. 5.6 - What is an output file?Ch. 5.6 - What is an input file?Ch. 5.6 - What three steps must be taken by a program when...Ch. 5.6 - What is the difference between a text file and a...Ch. 5.6 - Prob. 5.22CPCh. 5.6 - What type of object do you create if you want to...Ch. 5.6 - What type of object do you create if you want to...Ch. 5.6 - If you call the File.CreateText method and the...Ch. 5.6 - If you call the File.AppendText method and the...Ch. 5.6 - What is the difference between the WriteLine and...Ch. 5.6 - What method do you call to open a text file to...Ch. 5.6 - What is a files read position? Initially, where is...Ch. 5.6 - How do you read a line of text from a text file?Ch. 5.6 - How do you close a file?Ch. 5.6 - Assume inputFile references a StreamReader object...Ch. 5.7 - What is the benefit of using an Open and/or Save...Ch. 5.7 - Prob. 5.34CPCh. 5.8 - What does a Random objects Next method return?Ch. 5.8 - What does a Random objects NextDouble method...Ch. 5.8 - Write code that creates a Random object and then...Ch. 5.8 - Write code that creates a Random object and then...Ch. 5.8 - Prob. 5.39CPCh. 5.8 - What happens if the same seed value is used each...Ch. 5.9 - Prob. 5.41CPCh. 5.9 - Prob. 5.42CPCh. 5 - ListBox controls have an __________ method that...Ch. 5 - A __________ is commonly used to control the...Ch. 5 - A(n) __________ loop tests its condition before...Ch. 5 - The term __________ is used to describe a file...Ch. 5 - The term __________ file is used to describe a...Ch. 5 - A __________ file contains data that has been...Ch. 5 - When you work with a __________ file you access...Ch. 5 - Prob. 8MCCh. 5 - A __________ object is an object that is...Ch. 5 - When a program works with an input file, a special...Ch. 5 - When the user selects a file with the Open dialog...Ch. 5 - The __________ control displays a standard Windows...Ch. 5 - Once you have created a Random object, you can...Ch. 5 - Prob. 14MCCh. 5 - When you run an application, the applications form...Ch. 5 - If the ListBox is empty, the Items.Count property...Ch. 5 - To increment a variable means to increase its...Ch. 5 - When a variable is declared in the initialization...Ch. 5 - The while loop always performs at least one...Ch. 5 - The term read file is used to describe a file that...Ch. 5 - To append data to an existing file, you open it...Ch. 5 - As items are read from the file, the read position...Ch. 5 - The numbers that are generated by the Random class...Ch. 5 - Prob. 10TFCh. 5 - What is contained in the body of a loop?Ch. 5 - Write a programming statement that uses postfix...Ch. 5 - How many iterations will occur if the test...Ch. 5 - What are filename extensions? What do they...Ch. 5 - When an input file is opened, what is its read...Ch. 5 - How can you read all of the items in a file...Ch. 5 - What is a variable that is used to accumulate a...Ch. 5 - By default, the Open dialog box displays the...Ch. 5 - Prob. 9SACh. 5 - Prob. 10SACh. 5 - Write a loop that displays your name 10 times.Ch. 5 - Write a loop that displays all the odd numbers...Ch. 5 - Write a loop that displays every fifth number from...Ch. 5 - Write a code sample that uses a loop to write the...Ch. 5 - Assume that a file named People.txt contains a...Ch. 5 - Distance Calculator If you know a vehicles speed...Ch. 5 - Distance File Modify the Distance Calculator...Ch. 5 - Celsius to Fahrenheit Table Assuming that C is a...Ch. 5 - Prob. 4PPCh. 5 - Pennies for Pay Susan is hired for a job, and her...Ch. 5 - Prob. 6PPCh. 5 - Prob. 7PPCh. 5 - Prob. 8PPCh. 5 - Prob. 9PPCh. 5 - Addition Tutor Create an application that...Ch. 5 - Random Number Guessing Game Create an application...Ch. 5 - Calculating the Factorial of a Number In...Ch. 5 - Random Number File Writer Create an application...Ch. 5 - Random Number File Reader This exercise assumes...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
This is automatically provided for a class if you do not write one yourself. a. accessor method b. default inst...
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
The following statement should assign 0 to z if a is less than 10, otherwise it should assign 7 to z. What is w...
Starting Out with C++ from Control Structures to Objects (9th Edition)
A constructor that requires no arguments is called A) a default constructor B) an inline constructor C) a null ...
Starting Out with C++: Early Objects
True or False: If a subclass constructor does not explicitly call a superclass constructor, Java will not call ...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Write a program to print the corresponding Celsius to Fahrenheit table.
C Programming Language
A criticism of the break statement and the continue statement is that each is unstructured. Actually, these sta...
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- visual Basicarrow_forwardIf String str1 = new String("Final Exam");, the value of str1.indexOf('x') isarrow_forwardVBA - EXCEL Engine – optional – this indicates the solving method that needs to be used to get to a solution. 1 for the Simplex LP method, 2 for the GRG Nonlinear method, or 3 for the Evolutionary method. This corresponds to the Select a Solving Method dropdown list in the Solver Parameters dialog box EngineDesc – optional -this is an alternate way of selecting the solving method – here you would type the strings “Simplex LP”, “GRG Nonlinear” or “Evolutionary”. This also corresponds to the Select a Solving Method dropdown list in the Solver Parameters dialog box What happens when the code demonstrates: Engine:=1, EngineDesc:="GRG Nonlinear" ?arrow_forward
- function loginValidate () { var id = document.getElementById ('myid').value; var pass = document.getElementById('mypassword').value; if ((id == null : id alert ("ID and Pasword both must be filled out") : "") && (pass == null , pass == ")){ == return false: else if (id == null || id == "") { alert ("ID must be filled out "); return false; else if (pass == null || pass == "") { alert ("Password must be filled out "); return false;arrow_forwardPendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author’s name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application that reads records that contain an author’s name, the title of the work, and the number of volumes. The application must read the records until eof is encountered and produce enough labels for each work. The flowchart must include a call symbol, at the beginning, to redirect the input to the external data file. create a solution algorithm using pseudocode create a flowchart using RAPTORarrow_forwardPendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author’s name, the title of the work, and a volume number in the form Volume 9 of 9. For example, a set of three volumes requires three labels: Volume 1 of 3, Volume 2 of 3, and Volume 3 of 3. Design an application that reads records that contain an author’s name, the title of the work, and the number of volumes. The application must read the records until eof is encountered and produce enough labels for each work. Design a flowchart and psuedocode Pendant Publishing.arrow_forward
- PLEASE HELP ME! ? Maximize and use alternative method to this code! package com.btech.pf101; import java.io.bufferedreader; import java.io.inputstreamreader; import java.util.calendar; import java.util.date; public class pawnshopcode { private static final bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); private static string name; private static int age; private static string address; private static string contactno; private static int itemtype; private static string itemtypename; private static final int itemtype_gagdet = 1; private static final int itemtype_jewelry = 2; private static final int itemtype_musicinstrument = 3; private static final int itemtype_homeequipment = 4; private static final int itemtype_landtitle = 5; private static string itemdescription; private static int periodtype; private static string periodtypename; private static final int periodtype_days = 1; private…arrow_forward(-465)10 + (325)10 = ?arrow_forward#include "TerminalPlayer.h" Card TerminalPlayer::playCard(const Card& opponentCard) { // if the opponentCard is a Joker we are going first // if the opponentCard is not a Joker we are going second and opponentCard is what our opponent played // Display the player's hand // prompt them to choose a card // remove that card from the hand and return that cardarrow_forward
- # hard-coded calls # hard-coded linescouple = NumCouple(4, 7)print(f"The couples minimum is {couple.minimum()}")print(f"The couples maximum is {couple.maximum()}")print(f"The couples product is {couple.product()}")thruple = NumThruple(3, 5, 2)print(f"The thruples minimum is {thruple.minimum()}")print(f"The thruples maximum is {thruple.maximum()}")print(f"The thruples product is {thruple.product()}")arrow_forwardIn the class String, the substring method inserts a String into another String. -True or -Falsearrow_forwardVowels and Consonants Create an application with a method that accepts a string as an argument and returns the number of vowels that the string contains. The application should have another method that accepts a string as an argument and returns the number of consonants that the string contains. The application should let the user enter a string, and should display the number of vowels and the number of consonants it contains.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Control Structures - while loop - do-while loop - for loop - Goto - break - continue statements; Author: EzEd Channel;https://www.youtube.com/watch?v=21l11_9Osd0;License: Standard YouTube License, CC-BY