Answer:
import java.util.Scanner;
public class BarChart {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
//take input from user
System.out.println("Enter Score");
int score=sc.nextInt();
int count=score/10;
int i=1;
//print horizontal bar
//if you want to print vertical bar then simply change into print which is replace by println
while(i<=count)
{
System.out.print("*");
i++;
}
}
}
Explanation:
Answer:sorry
very cool didnt realy ask tho
Explanation:
Answer:
You'd have to create a "roomdata.txt" file before writing to it.
Explanation:
#Python Geometry
lenght = int(input("Enter lenght: "))
width = int(input("Enter width: "))
height = int(input("Enter height: "))
def floor_area(area);
area = 0
area = lenght * width
return area
def room_volume(vol);
vol = 0
vol = lenght * width * height
return vol
print ("Area of floor = ", floor_area, "/n Volume of room = ", room_volume)
f = open ("roomdata.text", "w")
f.write("Area of floor = ", floor_area, "/n Volume of room = ", room_volume)
f.close()
Answer:
Polymorphism
Explanation:
You can have a basic button class that gets inherited by other classes.
class Button {
function pushButton(){}
}
class ElevatorButton extends Button{};
class BigRedButton extends Button{};
With these new classes, they inherit from the basic button class. They can decide what happens when the method pushButton() is called.
You don't need to worry about what pushButton() actually does, you can just call it if the object is of the type "Button" and you can expect it to work.