Introduction To Programming Using Visual Basic (11th Edition)
11th Edition
ISBN: 9780135416037
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…
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, 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…
Chapter 6 Solutions
Introduction To Programming Using Visual Basic (11th 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
- 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_forwardQuestion-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_forward
- Scenario As you surely know, due to some astronomical reasons, years may be leap or common. The former are 366 days long, while the latter are 365 days long. Since the introduction of the Gregorian calendar (in 1582), the following rule is used to determine the kind of year: if the year number isn't divisible by four, it's a common year, otherwise, if the year number isn't divisible by 100, it's a leap year. otherwise, if the year number isn't divisible by 400, it's a common year. otherwise, it's a leap year. none of the above year int(input("enter the year")) if (year%4 1-0) and (year%400 -0) or (year % 1000): print (year is common year") else: print(year, is leap year") year= int(input ("enter the year")) if (years !-0) or (year480 1-0) and (year % 1001-0): print(year is common year") else: print(year, "is leap year") D year= int(input("enter the year"))arrow_forwardThe simplest income tax calculation for a single person filing federal income taxes in the United States involves applying a standard deduction, personal exemption and marginal tax rates to the annual income of the taxpayer. For tax year 2015, the standard deduction for an individual was $6300 and the personal exemption was $4000. The 2015 tax rates vary by income bracket and are given in the table below. Tax Rate 10% 15% 25% 28% 33% 35% 39.6% which equals $6203.50. You can calculate an "effective tax rate" based on the original income as Income Range $0.01-$9,225.00 $9,225.01-$37,450.00 $37,450.01-$90,750.00 $90,750.01-$189,300.00 $189,300.01-$411,500.00 $411,500.01-$413,200.00 Over $413,200 To compute the tax liability on a given income, first the deduction and exemption amounts are subtracted, then each portion of the income is taxed at the marginal rate according to the table. For example, for an income of $51,939 (US median income in 2014) you first apply the standard $6,300…arrow_forwardIf a year contains additional day (366), it is called "leap year". This extra day makes Februay 29 days long. Every 4 years a leap year occurs; However, it also depends on some additional conditions. A leap year is exactly divisible by 4 except for century years ending with 100. The century year can be leap year if it is divisible by 400. Examples: 2020, 2024 are leap year 2018, 2019 are not leap year 2000, 1600 are leap year, 1800 are not leap year. Write a code in C or Python that calculates if a year is a leap year or not that entered by user.arrow_forward
- Summary Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 payme If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: interest averageDailyBalance * 0.0152 Instructions Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month ( interestRate).arrow_forwardTwo gymnasts Write a program that uses find to determine how many events each gymnast won. (b) Use the mean function to determine each gymnasts average score.arrow_forwardA flight of stairs has 10 steps numbered 1 to 10 as shown in the figure below. i. How many ways could you climb up the set of stairs, assuming that you can skip any number of stairs with each step, but you must end on step 10 and you can only go up, never down and never remaining on the same step. ii. How many ways could you climb up the set of stairs, assuming you take exactly 4 steps. Again, your staircase climb ends on step 10. JAlthough there are different ways in which you could solve this problem, model the problem as a balls and bins problem for full credit.arrow_forward
- Excel output: The credit scores for 12 randomly selected adults who are considered high risk barrowers before and two years after they attend a personal finance seminar are given in Excel file under CREDIT SCORE sheet. You will run a significance test to check if there is enough evidence to support the claim that the personal finance seminar helps adults increase their credit scores. You’ll use α = 0.01 for significance test. a) At 0.01 significance level what decision should be made about the null hypothesis? In other words, should you reject or retain the null hypothesis?arrow_forwardTutorial 3: A simple force balance on a spherical particle reaching terminal velocity in a fluid is given by; |4g(P, -p)D, V : 3C,p Where Solution by Visual Basic V Terminal velocity in m/s g: Acceleration of gravity Pp: Particle density Dp: The diameter of the spherical particle in m CD: Dimensionless drag coefficient. The drag coefficient on a spherical particle at terminal velocity varies with Reynolds number (Re) as followings: Cp=24/Re Cp=24*(1+0.14* Re^0.7)/Re Cp=0.44 Cp=0.19-80000/Re Where, Re =(D, Vi p)/u =994.6 kg/m3 µ=0.0008931×kg/m.s. Calculate the terminal velocity of spherical particle using visual basic program? for Re< 0.1 for 0.1=arrow_forwardIn Saudi Arabia, the Kudai Parking Area is a parking lot that is next to the Ajyad Police Station and close to the Power Plant. Kudai is a well-known parking space near Masjid al-Haram. After parking there, you can take a taxi to Masjid al-Haram for 10-15 Riyals for a 10-minute drive. The parking is usually heavily occupied, and the following formula is used to compute the parking lot uțilization: Percentage of Parking Lot Utilized - Number of lots occupied + Total number of lots Write a program that calculates the occupancy rate for each zone of a massive parking lot like Kudai. The program should start by asking for the number of zones in the parking lot. A loop should then iterate once for each zone. During each iteration, the loop should ask the user for the number of lots in the zone and the number of them that are occupied. After all the iterations, the program should display the number of lots the parking has, the number of them that are occupied, the number that is vacant, and…arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
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