Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
What is wrong with my code, why is my if statement not working
Public Class Form1
Function HowManyBusses() As Integer
Dim AmountOfGirls As Integer = TextBox1.Text
Dim AmountOfBusses As Integer
AmountOfGirls = TextBox1.Text
AmountOfBusses = (AmountOfGirls / 15)
If (AmountOfBusses / 15) <> Mod 0 Then
AmountOfBusses += 0.5
End If
Return AmountOfBusses
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim answer As Integer = HowManyBusses()
MessageBox.Show("you will need " & answer & " buses")
End Sub
End Class
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 images
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
- in phython language Create a package folder named shapes. Inside this package, place two more package folders: 2d and 3d. Inside 2d package, place a module file: circle.py circle.py module has two function definitions: areaCircle(), circCircle(). areaCircle() function takes a parameter: radius, calculates and returns the area of the circle. You may assume PI is 3.14. circCircle() function also takes a parameter: radius, calculates and returns the circumference of the circle. Inside 3d package, place two module files: sphere.py and cylindir.py sphere.py module has two function definitions: areaSphere() and volumeSphere() which both take a parameter for radius, calculates and returns area and volume of a sphere respectively. cylindir.py module has two function definitions: areaCylindir() and volumeCylindir() which both take two parameters: height and radius. They calculate area and volume of a cylindir and return the values respectively. You may find the formulas for those shapes…arrow_forward#this is a python program #topic: OOP Design the Country class so that the code gives the expected output. [You are not allowed to change the code below] # Write your Class Code here country = Country() print('Name:',country.name) print('Continent:',country.continent) print('Capital:',country.capital) print('Fifa Ranking:',country.fifa_ranking) print('===================') country.name = “Belgium” country.continent = “Europe” country.capital = “Brussels” country.fifa_ranking = 1 print('Name:',country.name) print('Continent:',country.continent) print('Capital:',country.capital) print('Fifa Ranking:',country.fifa_ranking) Output: Name: Bangladesh Continent: Asia Capital: Dhaka Fifa Ranking: 187 =================== Name: Belgium Continent: Europe Capital: Brussels Fifa Ranking: 1arrow_forward(Financial application: payroll) Write a program that reads the following infor- mation and prints a payroll statement: Employee's name (e.g., Smith) Number of hours worked in a week (e.g., 10) Hourly pay rate (e.g., 9.75) Federal tax withholding rate (e.g., 20%) State tax withholding rate (e.g., 9%) A sample run is shown below: Enter employee's name: Smith Enter number of hours worked in a week: 10 Enter -Enter Enter hourly pay rate: 9.75 Enter federal tax withholding rate: 0.20 -Enter -Enter Enter state tax withholding rate: 0.09 Enter Employee Name: Smitharrow_forward
- 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 }arrow_forward// This class discounts prices by 10% public class DebugFour4 { public static void main(String args[]) { final double DISCOUNT_RATE = 0.90; int price = 100; double price2 = 100.00; tenPercentOff(price DISCOUNT_RATE); tenPercentOff(price2 DISCOUNT_RATE); } public static void tenPercentOff(int p, final double DISCOUNT_RATE) { double newPrice = p * DISCOUNT_RATE; System.out.println("Ten percent off " + p); System.out.println(" New price is " + newPrice); } public static void tenPercentOff(double p, final double DISCOUNT_RATE) { double newPrice = p * DISCOUNT_RATE; System.out.println"Ten percent off " + p); System.out.println(" New price is " + newprice); } }arrow_forward#include <iostream>using namespace std; class Date{ string year, month, day, hour, minute; public: Date(int=1990, int=1, int=1, int=12, int=1); Date(const Date &date); //getters: int getYear(); int getMonth(); int getDay(); int getHour(); int getMinute(); //setters: void setYear(int); void setMonth(int); void setDay(int); void setHour(int); void setMinute(int); //toString. string to_string();};class Player{private: string name; int age, goal;public: Player(string nname = "player", int nage = 25, int ngoal = 0); //getter string getname(); int getage(); int getgoal(); //setter void setname(string nname); void setage(int nage); void setgoal(int ngoale); //toString string to_string(); return 0; }; This is an C++ CODE i want your help to let the code run so if you can make itarrow_forward
- Must be in C++ and cannot come from any online source. Please include all requested parts in problem. Create a class named Employee that has the following member variables: name - a string that holds the employee's name empIdNumber - an int variable that holds the employee's ID Number job - a string that holds the name of the position the employee is working in (Laborer, Manager, Secretary, etc.) yearsOfService- an integer that holds the employee's years of service The class should have the following constructors: A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name, employee ID number, job and years of service that are passed to them when the object is created (pass each of the four values into the constructor) A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name and ID Number. The job field should be assigned an…arrow_forwardInteger userValue is read from input. Assume userValue is greater than 1000 and less than 99999. Assign tensDigit with userValue's tens place value. Ex: If the input is 15876, then the output is: The value in the tens place is: 7 2 3 public class ValueFinder { 4 5 6 7 8 9 10 11 12 13 GHE 14 15 16} public static void main(String[] args) { new Scanner(System.in); } Scanner scnr int userValue; int tensDigit; int tempVal; userValue = scnr.nextInt(); Your code goes here */ 11 System.out.println("The value in the tens place is: + tensDigit);arrow_forwardProject: Two Formulas in Separate Class Write two formulas your choice in separate file and you call it in some manner from your from main program. In Java the pic for examplearrow_forward
- here's the 3rd. Vehicle.cpp // Vehicle.cpp #include <iostream> using namespace std; class Vehicle { public: void setSpeed(double); double getSpeed(); void accelerate(double); void setFuelCapacity(double); double getFuelCapacity(); void setMaxSpeed(double); double getMaxSpeed(); private: double fuelCapacity; double maxSpeed; double currentSpeed; }; void Vehicle::setSpeed(double speed) { currentSpeed = speed; return; } double Vehicle::getSpeed() { return currentSpeed; } void Vehicle::accelerate(double mph) { if(currentSpeed + mph < maxSpeed) currentSpeed = currentSpeed + mph; else cout << "This vehicle cannot go that fast." << endl; } void Vehicle::setFuelCapacity(double fuel) { fuelCapacity = fuel; } double Vehicle::getFuelCapacity() { return fuelCapacity; } void Vehicle::setMaxSpeed(double max) { maxSpeed = max; } double Vehicle::getMaxSpeed() {…arrow_forwardFlight assignment runs but there is no imput values for the user to interact when running the program. Kindly fix this issue.import java.util.*; class Flight { String airlineCode; int flightNumber; char type; // D for domestic, I for international String departureAirportCode; String departureGate; char departureDay; int departureTime; String arrivalAirportCode; String arrivalGate; char arrivalDay; int arrivalTime; char status; // S for scheduled, A for arrived, D for departed public Flight(String airlineCode, int flightNumber, char type, String departureAirportCode, String departureGate, char departureDay, int departureTime, String arrivalAirportCode, String arrivalGate, char arrivalDay, int arrivalTime) { this.airlineCode = airlineCode; this.flightNumber = flightNumber; this.type = type; this.departureAirportCode = departureAirportCode; this.departureGate = departureGate;…arrow_forwardIn C++ Please: THE PROGRAM CANNOT CONTAIN -> OPERATORS! Create a class AccessPoint with the following: x - a double representing the x coordinate y - a double representing the y coordinate range - an integer representing the coverage radius status - On or Off Add constructors. The default constructor should create an access point object at position (0.0, 0.0), coverage radius 0, and Off. Add accessor and mutator functions: getX, getY, getRange, getStatus, setX, setY, setRange and setStatus. Add a set function that sets the location coordinates and the range. Add the following member functions: move and coverageArea. Add a function overLap that checks if two access points overlap their coverage and returns true if they do. Add a function signalStrength that returns the wireless signal strength as a percentage. The signal strength decreases as one moves away from the access point location. Represent this with bars like, IIIII. Each bar can represent 20% Test your class by writing a…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education