Introduction to Programming Using Visual Basic (10th Edition)
10th Edition
ISBN: 9780134542782
Author: David I. Schneider
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 6.1, Problem 41E
Population Growth In 2016 China's population was about 1.37 billion and growing at the rate of
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is:
90
the output is:
I-90 is primary, going east/west.
Ex: If the input is:
290
the output is:
I-290 is auxiliary, serving I-90, going east/west.
Ex: If the input is:
0
or any number not between 1 and 999, the output is:
0 is not a valid interstate highway number.
This is the code I am using, but something is not functioning properly.
import java.util.Scanner;
public class LabProgram{public static void main(String[] args) {Scanner scnr = new Scanner(System.in);int…
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is:
90
the output is:
I-90 is primary, going east/west.
Ex: If the input is:
290
the output is:
I-290 is auxiliary, serving I-90, going east/west.
Ex: If the input is:
0
or any number not between 1 and 999, the output is:
0 is not a valid interstate highway number.
This is the code I have but for some reason I keep getting errors. what am doing wrong?
import java.util.Scanner;
public class LabProgram {public static void main(String[] args) {Scanner scnr = new…
One hundred tickets, numbered 1, 2, 3, . . . , 100, are sold to 100 different people for a drawing.Four different prizes are awarded, including a grand prize. How many ways are there to awardthe prizes if:a) the person holding ticket 35 wins the grand prize?b) the person holding ticket 64 wins one of the prizes?c) the person holding ticket 18 does not win a prize?d) the people holding tickets 30 and 50 both win prizes?
Chapter 6 Solutions
Introduction to Programming Using Visual Basic (10th 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
- Stock Return Performance Analysis: An investment firm monitors the daily returns of a particular stock in the S&P 500. The daily return is defined as the percentage change in the stock's price from the previous day. The firm recorded the stock's daily returns at random times during the last quarter of the year. Assume that the standard deviation of the population of daily returns is known to be σ = 2.8%. The data for daily return for the particular stock in the S&P 500 is given in Excel under “DAILY RETURN” sheet. a) Find the mean and the standard deviation of 20 random samples of daily returns.? b) Based on a 95% confidence level, what is the margin of error for the mean estimate of the daily return? c) Given the margin of error computed in part (b), provide a 95% confidence interval for μ, the mean daily return for this stock. The stock’s long-term average daily return is stated as 1.5%. Are the results of this analysis consistent with the stock’s long-term…arrow_forwardStock Return Performance Analysis: An investment firm monitors the daily returns of a particular stock in the S&P 500. The daily return is defined as the percentage change in the stock's price from the previous day. The firm recorded the stock's daily returns at random times during the last quarter of the year. Assume that the standard deviation of the population of daily returns is known to be σ = 2.8%. The data for daily return for the particular stock in the S&P 500 is given in Excel under “DAILY RETURN” sheet. a) Find the mean and the standard deviation of 20 random samples of daily returns.?arrow_forwardStock Return Performance Analysis: An investment firm monitors the daily returns of a particular stock in the S&P 500. The daily return is defined as the percentage change in the stock's price from the previous day. The firm recorded the stock's daily returns at random times during the last quarter of the year. Assume that the standard deviation of the population of daily returns is known to be σ = 2.8%. The data for daily return for the particular stock in the S&P 500 is given in Excel under “DAILY RETURN” sheet. a) Based on a 95% confidence level, what is the margin of error for the mean estimate of the daily return?arrow_forward
- Stock Return Performance Analysis: An investment firm monitors the daily returns of a particular stock in the S&P 500. The daily return is defined as the percentage change in the stock's price from the previous day. The firm recorded the stock's daily returns at random times during the last quarter of the year. Assume that the standard deviation of the population of daily returns is known to be σ = 2.8%. The data for daily return for the particular stock in the S&P 500 is given in Excel under “DAILY RETURN” sheet. a) Given the margin of error computed in part (b), provide a 95% confidence interval for μ, the mean daily return for this stock. The stock’s long-term average daily return is stated as 1.5%. Are the results of this analysis consistent with the stock’s long-term performance?arrow_forwardStock Return Performance Analysis: An investment firm monitors the daily returns of a particular stock in the S&P 500. The daily return is defined as the percentage change in the stock's price from the previous day. The firm recorded the stock's daily returns at random times during the last quarter of the year. Assume that the standard deviation of the population of daily returns is known to be σ = 2.8%. The data for daily return for the particular stock in the S&P 500 is given in Excel under “DAILY RETURN” sheet. a) Based on a 95% confidence level, what is the margin of error for the mean estimate of the daily return? b) Given the margin of error computed in part (b), provide a 95% confidence interval for μ, the mean daily return for this stock. The stock’s long-term average daily return is stated as 1.5%. Are the results of this analysis consistent with the stock’s long-term performance?arrow_forwardPrimary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999 and service the primary highway indicated by the rightmost two digits. Thus, the 405 services the 5, and the 290 services the 90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also, indicate if the (primary) highway runs north/south or east/west. Ex: If the input is: 90 The output is: The 90 is primary, going east/west. Ex: If the input is: 290 The output is: The 290 is auxiliary, serving the 90, going east/west. Ex: If the input is: 0 Or any number not between 1 and 999, the output is: 0 is not a valid interstate highway number. import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int highwayNumber; int…arrow_forward
- HW2 In an experiment to determine the spring constant of an elastic cord of length 0.60 m, a student hangs the cord from a rod as represented and then attaches a variety of weights to the cord. For each weight, the student allows the weight to hang in equilibrium and then measures the entire length of the cord. The data are recorded in the table below Į Weight (N) 0 10 15 20 25 Length (m) 0.60 0.97 1.24 1.37 1.64 1- Plot the force/elongation curve using Matlab. 2- Deduce the spring constant of the cord.arrow_forwarduse visual basic Depreciation to a Salvage Value of 0 . For tax purposes an item may be depreciated over a period of several years, n . With the straight-line method of depreciation , each year the item dpreciates by 1/nth of it original value. with the double-declining-balance method of depreciation, each year the item depreciate by 2/nths of its value at the beginning of that year.(In the final year it is depreciated by its value at the beginning of the year. ) Write a program that performs the following tasks:(a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. The method of depreciation should be chosen by clicking on one of two buttons.(b) Display a year- by-year description of the depreciation. See Fig. 6.15 .arrow_forward1. Calculate the Overtime Pay for 5 Service men Enter the Service man Name, Enter the Type of Service, Enter Monthly Basic Salary, Enter Number of Days of Overtime. The options of Type of Service men will be "Army", “Navy" and “Airforce". If the type of Service is "Airforce'", the Overtime Rate is 30%. If the type of Service is “Army", the Overtime Rate is 28%. If the type of Service is “Navy", the Overtime Rate is 26%. Overtime pay = Daily rate * Numbers of Days Overtime * Overtime Rate. Daily rate = Monthly Basic Salary / 22. Display Service man Name / Service Type / Daily Rate / Overtime Pay for all the 5 Service men Save your shell script as servicemen.sharrow_forward
- Question-related to R code The English Premier League (EPL) is a major soccer league in Great Britain consisting of 20 teams. The season begins in August and concludes in May with each team playing each other team exactly twice (home and away). Each team plays 38 games in a season while the total number of games is 380. A team receives 3 points for a win and if the game is tied, both teams receive 1 point; no points are awarded for a loss. The EPL game results are found at http://www.football-data.co.uk/englandm.php under the heading Premier League. Your Question: Develop a function with the inputs of date and season that returns the league standings for the date and season specified. The season specified should, at a minimum, accept the current seasons and both of the two most recently completed seasons in order for your submission to be eligible for full credit. Data: The csv data files available via the weblink provided above contain a lot of information that is not needed…arrow_forwardComputer Science MIPS assembly language program using Procedure to find the grade of a student, given the marks of Final (30%), Midterm (20%), quizzes and homework (25%), and projects (25%). Given the marks of above 4 out of 100 points, we have to print the grade of a student based on the following grade slab. 1. Percentage > 90, grade is an A 2. If 80arrow_forwardPrimary U.S. interstate highways are numbered 1-99. • Odd numbers (like the 5 or 95) go north/south, and even numbers (like the 10 or 90) go east/west. • Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, 1-405 services 1-5, and 1-290 services 1-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also, indicate if the (primary) highway runs north/south or east/west. Use the information above to write several functions to help you determine this information. Call these functions in your main program to produce the requested output. Instructions The functions Write a function get_direction () that expects a highway number. • Returns a string "north/south" if the highway number is odd (like the 5 or 95); • Returns "east/west" if the highway number is even (like the 10 or 90). If the function is called with the following input 290 the…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Boolean Algebra - Digital Logic and Logic Families - Industrial Electronics; Author: Ekeeda;https://www.youtube.com/watch?v=u7XnJos-_Hs;License: Standard YouTube License, CC-BY
Boolean Algebra 1 – The Laws of Boolean Algebra; Author: Computer Science;https://www.youtube.com/watch?v=EPJf4owqwdA;License: Standard Youtube License