Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 1, Problem 4PP
Suppose your instructor gives three exams during the semester and you want to write a
- a. What items of input must the user enter?
- b. Once the input has been entered, how will the program determine the average?
- c. What output will the program display?
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Instructions
A local biologist needs a program to predict population growth. The inputs would be:
1. The initial number of organisms, as an int
2. The rate of growth (a real number greater than 1), as a float
3. The number of hours it takes to achieve this rate, as an int
4. A number of hours during which the population grows, as an int
For example, one might start with a population of 500 organisms, a growth rate of 2, and a growth period to achieve this rate of 6 hours. Assuming that none of the organisms die, this would imply that this population would double in size every 6 hours. Thus, after allowing 6 hours for growth, we would have 1000 organisms, and after 12 hours, we would have 2000 organisms.
Write a program that takes these inputs and displays a prediction of the total population.
An example of the program input and output is shown below:
Enter the initial number of organisms: 10
Enter the rate of growth (a real number › 1]: 2
Enter the number of hours to achieve the…
4. c. Display all the numbers the user entered that are greater than 100. Numbers smaller than 100 are ignored. The numbers should be displayed in the same order as they were entered by the user. Develop a simulation program to simulate the appearance of text message a phone receives. a. Ask user how many text messages one would receive in 12 hours. b. Ask user how many hours the user wants to run the simulation. C. Your program will display the number of seconds from the beginning of the simulation when a text message is received like this: 452 890 1593.
Computer science
Chapter 1 Solutions
Starting out with Visual C# (4th Edition)
Ch. 1.2 - What is a program?Ch. 1.2 - What is hardware?Ch. 1.2 - List the five major components of a computer...Ch. 1.2 - What part of the computer actually runs programs?Ch. 1.2 - Prob. 1.5CPCh. 1.2 - Prob. 1.6CPCh. 1.2 - Prob. 1.7CPCh. 1.2 - Prob. 1.8CPCh. 1.2 - Prob. 1.9CPCh. 1.2 - What do you call a program that performs a...
Ch. 1.2 - Word processing programs, spreadsheet programs,...Ch. 1.3 - What amount of memory is enough to store a letter...Ch. 1.3 - Prob. 1.13CPCh. 1.3 - Prob. 1.14CPCh. 1.3 - Prob. 1.15CPCh. 1.3 - Prob. 1.16CPCh. 1.3 - Prob. 1.17CPCh. 1.4 - A CPU understands instructions that are written...Ch. 1.4 - Prob. 1.19CPCh. 1.4 - When a CPU executes the instructions in a program,...Ch. 1.4 - What is assembly language?Ch. 1.4 - What type of programming language allows you to...Ch. 1.4 - Prob. 1.23CPCh. 1.4 - What do you call a program that translates a...Ch. 1.4 - What do you call a program that both translates...Ch. 1.4 - Prob. 1.26CPCh. 1.5 - What is a user interface?Ch. 1.5 - How does a command line interface work?Ch. 1.5 - Prob. 1.29CPCh. 1.5 - Prob. 1.30CPCh. 1.6 - What is an object?Ch. 1.6 - Prob. 1.32CPCh. 1.6 - What two general capabilities does an object have?Ch. 1.6 - Prob. 1.34CPCh. 1.6 - What is the purpose of an object that cannot be...Ch. 1.6 - What is a class?Ch. 1.6 - Prob. 1.37CPCh. 1.6 - Why might you need to write your own classes?Ch. 1.7 - Prob. 1.39CPCh. 1.7 - What is an algorithm?Ch. 1.7 - What is pseudocode?Ch. 1.7 - Prob. 1.42CPCh. 1.7 - Prob. 1.43CPCh. 1.8 - Prob. 1.44CPCh. 1.8 - Prob. 1.45CPCh. 1.8 - Prob. 1.46CPCh. 1.8 - Prob. 1.47CPCh. 1.8 - What is a ToolTip?Ch. 1.8 - Prob. 1.49CPCh. 1.8 - Prob. 1.50CPCh. 1 - A(n) __________ is a set of instructions that a...Ch. 1 - Prob. 2MCCh. 1 - Prob. 3MCCh. 1 - Prob. 4MCCh. 1 - Prob. 5MCCh. 1 - Prob. 6MCCh. 1 - Prob. 7MCCh. 1 - Prob. 8MCCh. 1 - Prob. 9MCCh. 1 - Prob. 10MCCh. 1 - Prob. 11MCCh. 1 - Prob. 12MCCh. 1 - Prob. 13MCCh. 1 - Prob. 14MCCh. 1 - Prob. 15MCCh. 1 - Prob. 16MCCh. 1 - Prob. 17MCCh. 1 - Prob. 18MCCh. 1 - If you were to look at a machine language program,...Ch. 1 - Prob. 20MCCh. 1 - Prob. 21MCCh. 1 - The_____ translates an assembly language program...Ch. 1 - The words that make up a high-level programming...Ch. 1 - Prob. 24MCCh. 1 - A(n)_____ is a program that translates a...Ch. 1 - Prob. 26MCCh. 1 - A______ error does not prevent the program from...Ch. 1 - A(n) _______ is a set of well-defined logical...Ch. 1 - An informal language that has no syntax rules and...Ch. 1 - A _______ is a diagram that graphically depicts...Ch. 1 - Objects that are visible in a programs graphical...Ch. 1 - A _____ is code that describes a particular type...Ch. 1 - The _____ is a collection of classes and other...Ch. 1 - The ______ is the part of a computer with which...Ch. 1 - Before GUIs became popular, the ______ interface...Ch. 1 - __________ programs are usually event driven. a....Ch. 1 - Today, CPUs arc huge devices made of electrical...Ch. 1 - Prob. 2TFCh. 1 - Any piece of data that is stored in a computers...Ch. 1 - Prob. 4TFCh. 1 - Machine language is the only language that a CPU...Ch. 1 - Assembly language is considered a high-level...Ch. 1 - An interpreter is a program that both translates...Ch. 1 - A syntax error does not prevent a program from...Ch. 1 - Prob. 9TFCh. 1 - Word processing programs, spreadsheet programs,...Ch. 1 - Programmers must be careful not to make syntax...Ch. 1 - C# provides only the basic keywords and operators...Ch. 1 - Why is the CPU the most important component in a...Ch. 1 - Prob. 2SACh. 1 - Prob. 3SACh. 1 - What are the words that make up a high-level...Ch. 1 - What are the short words that are used in assembly...Ch. 1 - What is the difference between a compiler and an...Ch. 1 - Prob. 7SACh. 1 - Prob. 8SACh. 1 - Prob. 9SACh. 1 - Prob. 10SACh. 1 - Can you use C# alone to perform advanced...Ch. 1 - Prob. 12SACh. 1 - Prob. 13SACh. 1 - Prob. 14SACh. 1 - Prob. 15SACh. 1 - How can you view the projects form if it is not...Ch. 1 - Use what youve learned about the binary numbering...Ch. 1 - Use what youve learned about the binary numbering...Ch. 1 - Look at the ASCII chart in Appendix C and...Ch. 1 - Suppose your instructor gives three exams during...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What would be the hexadecimal representation of the largest memory address in a memory consisting of 4MB if eac...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
In Exercises 53 through 56, determine the output produced by the lines of code where Courier New is the font se...
Introduction To Programming Using Visual Basic (11th Edition)
Determine the magnitude and orientation of FB so that the resultant force is directed along the positive y axi...
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
The solid steel shaft AC has a diameter of 25 mm and is supported by smooth bearings at D and E. It is coupled ...
Mechanics of Materials (10th Edition)
This optional Google account security feature sends you a message with a code that you must enter, in addition ...
SURVEY OF OPERATING SYSTEMS
Big data Big data describes datasets with huge volumes that are beyond the ability of typical database manageme...
Management Information Systems: Managing The Digital Firm (16th Edition)
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
- Context for question: The user inputs the secret number, then the computer guesses your secret number by randomly generating numbers. The program should automatically output if the user's secret number is higher or lower than the computer's guess. The computer can then use this information for its next random guess. Although the computer's guesses are random, think of ways to make the computer's guesses intelligent, without the computer using the secret number the user entered (that would be cheating on the part of the computer). #include #include #include int main() { int secretNumber, guess; printf("Enter Secret Number: "); scanf("%d", &secretNumber); do { guess = (rand() % 100 + 1); printf("The guess is %d", guess); if (secretNumber == guess){ printf("\nYour guess is correct. Congratulations!\n"); }else if(secretNumber > guess){ printf("\nYour secret number is higher than the guess…arrow_forwardComputer Science Godot Programming Programming Problem 1. Rock, Paper, Scissors This is your traditional rock-paper-scissors game, where two players select one of the three options and a result is produced based on their selection. For reference: Rock beats scissors Paper beats rock Scissors beats paper For this problem, you are to assume that two human players will play against each other and will input their choices accordingly. The input for each player will be in the form of buttons. Once a player clicks on a button, the rest of their buttons are locked in place (i.e. disabled). Once the other player selects their pick, the program outputs who won or if there was a draw. This isn’t exactly the most realistic way to code the game as it would be better if both players made their choice at the same time, but we’ll just have to chalk this up as a limitation for our exam. Aside from the game itself, the program should track the score of each player. Basically, if one wins, that…arrow_forwardCorrect and detailed answer please. Thank you!arrow_forward
- Java Programming control structures:\ The population of Town A is less than the population of Town . However, the population of Town A is growing faster than the population of Town B. Write a program that prompts the user to enter the population and growth rate of each town. The program outputs after how many years the population of Town Aa will be greater than or equal to the population of Town B and the populations of both towns at that time. Sample input is: Population of Town A = 5,000, growth rate of town A =4%, populatio of Town B = 8,000, and growth rate of town B = 2% Here's my code and something is not right static Scanner console = new Scanner(System.in);public static void main(String[] args) {int populationA;int populationB;int projectedYears; int futurePopulation;double townAGrowthRate;double townBGrowthRate;System.out.print("Enter the population for Town A and Town B "+ "(population of Town A should be less than Town B): \n");populationA = console.nextInt();populationB =…arrow_forwardNote: write a Jave Progame below Question2: Suppose a retail business sells an item that is regularly priced at $98 and is planning to have a sale where the item s price will he reduced by 25 percent. You have been asked to write a program to calculate the sale price of the item. To determine the sale price you perform two calculations: you get the amount of the discount, which is 25 percent of the item's regular price. you subtract the discount amount from the item's regular price. This gives you the sale price.arrow_forwardWhen Jacob Steinberg began his trip from California to Vermont, he filled his car’s tank with gas and reset its trip meter to 0. After traveling 324 miles, Jacob stopped at a gas station to refuel; the gas tank required 17 gallons. Jacob wants a program that calculates and displays his car’s gas mileage at any time during the trip. The gas mileage is the number of miles his car can be driven per gallon of gas. Desk-check your solution’s algorithm using 324 as the number of miles driven and 17 as the number of gallons used; then desk-check it using 280 and 15.arrow_forward
- answer this question in Pythonarrow_forward1. For this problem, you are going to design a game for the children to teach them about numbers. You are going to take numbers as input from the user as long as he has not entered an even number. If enters odd number, ask him again to give input. When he enters an even number, print that the number is even, and you have won. The program should include the following specifications: É) This will go on, until the user gives an even number input F) When you find an even number, print, "You win! is an even number"arrow_forwardA palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome. Ex: If the input is: bob the output is: palindrome: bob Ex: If the input is: bobby the output is: not a palindrome: bobby Hint: Start by just handling single-word input, and submit for grading. Once passing single-word test cases, extend the program to handle phrases. If the input is a phrase, remove or ignore spaces. 367012.2549490.qx3zqy7 LAB 5.25.1: LAB: Palindrome 6/ 10 ACTIVITY LabProgram.java Load default template.. 1 import java.util.Scanner; 3 public class LabProgram { public static void main(String[] args) { /* Type your code here. */ } 7 } 4 5 8arrow_forward
- A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome. Ex: If the input is: bob the output is: palindrome: bob Ex: If the input is: bobby the output is: not a palindrome: bobby Hint: Start by removing spaces. Then check if the string equals itself in reverse.arrow_forwardPhyton The program that you create for this exercise will begin by reading the cost of a meal ordered at a restaurant from the user. Then your program will compute the tax and tip for the meal. Use your local tax rate when computing the amount of tax owing. Compute the tip as 18 percent of the meal amount (without the tax). The output from your program should include the tax amount, the tip amount, and the grand total for the meal including both the tax and the tip. Format the output so that all of the values are displayed using two decimal places.arrow_forwardWrite a "Guess My Number Game" program. The program generates a random integer in a specified range, and the user (the player) has to guess the number. The program allows the use to play as many times as he/she would like; at the conclusion of each game, the program asks whether the player wants to play again. The basic algorithm is: 1. The program starts by printing instructions on the screen. 2. For every game: the program generates a new random integer in the range from MIN to MAX. Treat MIN and MAX like constants; start by initializing them to 1 and 100 ► loop to prompt the player for a guess until the player correctly guesses the integer for each guess, the program prints whether the player's guess was too low, too high, or correct at the conclusion (when the integer has been guessed): ➤ print the total number of guesses for that game print a message regarding how well the player did in that game (e.g., the player took way too long to guess the number, the player was awesome,…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY