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 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, 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…
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
- 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…arrow_forwardlast 3 digits of enrolment number - 308 Let a, b and c denote the last three digits of your enrolment number (so for example with enrolment number 001054321, you would take a = 3, b = 2 and c = 1) and then take each of them (mod 2). So in the example above, a, b and c would become 1, 0, 1 respectively (each digit taken (mod 2)). Consider the polynomial . (a) Create a polynomial code of codeword length 8 from this generating polynomial. (b) Is your code cyclic? Justify your answer.arrow_forwardHW2 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_forward
- 1. 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_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_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, I- 405 services 1-5, and I-290 services 1-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number. 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 the output is: 0 is not a valid interstate highway number. Ex: If the input is: 200 the output is: 200 is not a valid interstate highway number. See Wikipedia for more info on highway numberingarrow_forward
- 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, 1-405 services 1-5, and 1-290 services 1-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number. 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 the output is: 0 is not a valid interstate highway number. Ex: If the input is: 200 the output is: 200 is not a valid interstate highway number.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, I-405 services I-5, and I-290 services I-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number. 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 the output is: 0 is not a valid interstate highway number. Ex: If the input is: 200 the output is: 200 is not a valid interstate highway number.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, I-405 services I-5, and I-290 services I-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number. 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.arrow_forward
- If 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_forwardSummary 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_forwardHelp me!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 LearningNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
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
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