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 4.6, Problem 4.20CP
If the following code were part of a complete program, what would it display?
if (String.Compare("z", "a") < 0)
{
MessageBox.Show("z is less than a.");
}
else
{
MessageBox.Show("z is not less than a.");
}
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Computer Science
if (e.pane.length > 1){ZayTestControl. size = newSize(TestControl.width,e.Panes[1].lSize.Height--DiffInPaneControlsize);
if(Now > TestControl.Size.Height){ZayTestcontrol.Location = new Point(0, TestControl.Location.Y +_DiffInPaneControlSize);
}
}
what is this code doing C# windows form? please write comments
Word Sleuth Puzzle Program
in this code, the integer on each line shows the line number that is not part of code: what are the parameters of sum: ____
1 public static int sum(int x, int y){
2 int z = x +y;
3 return z;
4 }
5 public static void main(String[] args){
6 …
7 sum(a+2, b);
8 …
9 }
Chapter 4 Solutions
Starting Out With Visual C# (5th Edition)
Ch. 4.1 - What is a control structure?Ch. 4.1 - What is a decision structure?Ch. 4.1 - Prob. 4.3CPCh. 4.1 - Prob. 4.4CPCh. 4.1 - What types of relationships between numeric values...Ch. 4.1 - Write an if statement that determines whether the...Ch. 4.1 - Write an if statement that determines whether the...Ch. 4.2 - Prob. 4.8CPCh. 4.2 - In an if-else statement, under what circumstances...Ch. 4.2 - Write an if-else statement that works like this:...
Ch. 4.3 - Convert the following set of nested if-else...Ch. 4.4 - Prob. 4.12CPCh. 4.4 - Prob. 4.13CPCh. 4.4 - Assume the variables a = 2, b = 4, and c = 6....Ch. 4.4 - Explain how short-circuit evaluation works with...Ch. 4.4 - Write an if statement that displays the message...Ch. 4.4 - Write an if statement that displays the message...Ch. 4.5 - Prob. 4.18CPCh. 4.5 - Prob. 4.19CPCh. 4.6 - If the following code were part of a complete...Ch. 4.6 - If the following code were part of a complete...Ch. 4.7 - Prob. 4.22CPCh. 4.7 - If a TryParse method successfully converts the...Ch. 4.7 - Prob. 4.24CPCh. 4.7 - Prob. 4.25CPCh. 4.9 - Prob. 4.26CPCh. 4.9 - If several CheckBox controls have been created in...Ch. 4.9 - Prob. 4.28CPCh. 4.10 - Convert the following if-else-if code to a switch...Ch. 4.11 - Prob. 4.30CPCh. 4.11 - Prob. 4.31CPCh. 4.11 - Prob. 4.32CPCh. 4 - A __________ structure executes a set of...Ch. 4 - A __________ structure provides one alternative...Ch. 4 - A(n) __________ expression has a value of either...Ch. 4 - The symbols , , and == are all __________...Ch. 4 - A __________ structure tests a condition and then...Ch. 4 - You use a(n) __________ statement to write a...Ch. 4 - You use a(n) __________ statement to write a dual...Ch. 4 - A ____________ decision structure is written...Ch. 4 - , ||, and ! are __________ operators. a....Ch. 4 - A compound Boolean expression created with the...Ch. 4 - A compound Boolean expression created with the...Ch. 4 - The __________ operator takes a Boolean expression...Ch. 4 - A __________ is a Boolean variable that signals...Ch. 4 - Prob. 14MCCh. 4 - Prob. 15MCCh. 4 - Prob. 16MCCh. 4 - The __________ section of a switch statement is...Ch. 4 - A ListBoxs index numbering starts at __________....Ch. 4 - You can use the __________ property to determine...Ch. 4 - The __________ property holds the item that is...Ch. 4 - Prob. 1TFCh. 4 - A single-alternative decision structure tests a...Ch. 4 - The if-else statement is a dual-alternative...Ch. 4 - A decision structure can be nested inside another...Ch. 4 - A compound Boolean expression created with the ...Ch. 4 - Prob. 6TFCh. 4 - Multiple CheckBox controls in the same GroupBox...Ch. 4 - The test expression in a switch statement can be a...Ch. 4 - If an item is not selected in a ListBox, the...Ch. 4 - Prob. 10TFCh. 4 - What is meant by the term conditionally executed?Ch. 4 - You need to test a condition and then execute one...Ch. 4 - Briefly describe how the operator works.Ch. 4 - Briefly describe how the || operator works.Ch. 4 - Prob. 5SACh. 4 - What is a flag and how does it work?Ch. 4 - What are the two arguments that you pass to a...Ch. 4 - How do you determine in code whether a RadioButton...Ch. 4 - Prob. 9SACh. 4 - Prob. 10SACh. 4 - Write an if statement that assigns 20 to the...Ch. 4 - Write an if statement that assigns 0 to the...Ch. 4 - Write an if-else statement that assigns 0 to the...Ch. 4 - Write nested decision structures that perform the...Ch. 4 - Write an if-else statement that displays Speed is...Ch. 4 - Write an if-else statement that determines whether...Ch. 4 - Prob. 7AWCh. 4 - Rewrite the following if-else-if statement as a...Ch. 4 - Prob. 9AWCh. 4 - Roman Numeral Converter Create an application that...Ch. 4 - Mass and Weight Scientists measure an objects mass...Ch. 4 - Magic Dates The date June 10, 1960, is special...Ch. 4 - Color Mixer The colors red, blue, and yellow are...Ch. 4 - Prob. 5PPCh. 4 - Book Club Points Serendipity Booksellers has a...Ch. 4 - Software Sales A software company sells a package...Ch. 4 - Body Mass Index Program Enhancement In Programming...Ch. 4 - Change for a Dollar Game Create a change-counting...Ch. 4 - Fat Percentage Calculator One gram of fat has 9...Ch. 4 - Time Calculator Create an application that lets...Ch. 4 - Workshop Selector The following table shows a...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
In an IfThenElseIf statement, what is the purpose of a trailing Else?
Starting Out With Visual Basic (8th Edition)
This optional Google account security feature sends you a message with a code that you must enter, in addition ...
SURVEY OF OPERATING SYSTEMS
Land Calculation One acre of land is equivalent to 43,560 square feet. Write a program that asks the user to en...
Starting Out with Python (4th Edition)
Suppose the Vole memory cells at addresses 0xF0 to 0xF9 contain the bit patterns described in the following tab...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Define the following arrays: A) empNum, a 100 -element array of ints B) payRate, a 25-element array of doubles ...
Starting Out with C++: Early Objects (9th Edition)
The following program is used in a bookstore to determine how many discount coupons a customer gets. Complete t...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
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
- Name format: You must use String object and not StringBuffer or StringBuilder. Many documents use a specific format for a person's name. Write a program that take one Line as an input. Example: Scanner input = new Scanner(System.in); System.out.println(“Enter firstName middleName lastName separated by at least one blank, It may have more than one blank separating firstName middleName lastName."); Input sample : Pat Silly Doe || Note these are separated by at least one blank. String line = input.nextLine() Ex: If the input is: Pat Silly Doe the output is: Doe, P.S. If the input has the form: firstName lastName the output is: lastName, firstInitial. Ex: If the input is: Julia Clark the output is: Clark, J. Please submit the .java source file and the sample run in a text file. Thanksarrow_forward// This program assigns values to two variables // and performs mathematical operations with them public class DebugFour1 { publicstaticmain(Stringargs[]) { int x =5 int y =8; System.out.println("adding " + x + y); int z =19; System.out.println("subtracting " + z - y); System.out.println("dividing " + z / x); System.out.println("multiplying " + x / z); } }arrow_forwardIn the class String, the substring method inserts a String into another String. -True or -Falsearrow_forward
- // Converts a string to lowercase, and // displays the string's length // as well as a count of letters public class DebugSeven4 { publicstaticvoidmain(String[] args) { String aString ="HELP!! I need to get 37 things DONE today!!"; int numLetters =0. int stringLength = aString.Length(); System.out.println("In all lowercase, the sentence is: "); for(int i =0; i < stringLength; i++) { char ch = Character.toTheLowerCase(aString.charAt(i)); System.out.print(ch); if(Character.isLetter(ch)) numLetters--; } System.out.println(); System.out.println ("The number of CHARACTERS in the string is " + stringLength); System.out.println(The number of LETTERS is " + numLetters); } }arrow_forward1._- DO NOT COPY FROM OTHER WEBSITES Correct answer will be Upvoted else downvoted. Thank you!!!.arrow_forwardSlot Machine Simulation- I need to get answer in Pseudocode A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money, which the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Instead of displaying images, the program will randomly select a word from the following list: Cherries, Oranges, Plums, Bells, Melons, Bars The program will select and display a word from this list three times. If none of the randomly selected words match, the program will inform the user that he or she has won $0. If two of the words match, the program will inform the user that he or she has won two times the amount entered. If three of the words…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_forwardDescription Write a Java program that compares two Strings. You have to declare a String text1 and assign it the value "programming" and then declare another String text2 and assign it the value "development". Your program should do the following: If the two Strings are exactly the same print to the screen "Exactly the same: True" otherwise print "Exactly the same: False". You may use boolean variables. If and only if the first comparison was false, a comparison should be done that ignores case sensitivity. If they are the same while ignoring the case print to the screen "Similar: True" otherwise print "Similar: False". Sample Input These sentences are the same. These sentences are the same. Sample Output Exactly the same: True Sample Input This sentence has Upper case and Lower case letters. This sentence has upper case and lower case letters. Sample Output Exactly the same: False Similar: True Sample Input Well something is wrong here Obviously they will get a false output Sample…arrow_forwardExercise Ex. 1: Find a regular expression over the alphabet { a, b} that contain exactly three a's. Ex. 2: Find a regular expression over the alphabet { a, b} that end with ab. Ex. 3: Find a regular expression over the alphabet { a, b} that has length of 3. Ex. 4: Find a regular expression over the alphabet { a, b } that contain exactly two successive a's. Ex. 5: Find the output (words) for the following regular expressions.arrow_forward
- language using - Javaarrow_forwardExtreme Fizz BuzzFizz Buzz is a classic Computer Science problem about Selection. For an integer x, print:• “Fizz” if x is only divisible by 3,• “Buzz” if x is only divisible by 5,• “FizzBuzz” if x is divisible by both 3 and 5,• the number x if it is not divisible by both 3 and 5.This problem is the extreme version of Fizz Buzz. You are given a list of K distinct integers A and a list of K characters S. Both lists are numbered from 1 to K. The integer Ai corresponds to the character Si. Denote B as the subset of A. There will be a rule for each possible subset: if an integerx is only divisible by all elements in B, print a string which is the concatenation of the corresponding character of each element in B, sorted by the index in ascending order. However, if B is an empty subset, print the first digit of x instead. Does it look complicated? Do not worry, as it is just a generalization of the regular Fizz Buzz. For example, if A = [3, 5] and S = [F, B], you will get the normal Fizz…arrow_forwardin this code, the integer on each line shows the line number that is not part of code: what is he local variables of sum: ____ 1 public static int sum(int x, int y){ 2 int z = x +y; 3 return z; 4 } 5 public static void main(String[] args){ 6 … 7 sum(a+2, b); 8 … 9 }arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY