The Java programs for your requirement given below,
Problem3 Java code:
import java.util.Scanner;
public class ElectricityCharge {
public static void main(String aa[]) {
double units, charge = 0,
additional, total;
Scanner ss = new
Scanner(System.in);
System.out.println("Enter
Electricity unit");
units = ss.nextDouble(); //
get units from user
if (units > 0 && units
<= 50) {
charge = units *
0.50; // calculate charge
} else if (units > 50 &&
units <= 150) {
charge = units *
0.75;
} else if (units > 150
&& units <= 250) {
charge = units *
1.20;
} else if (units > 250) {
charge = units *
1.50;
}
additional = charge * 0.2;
// calculate additional charge
total = charge + additional;
// calculate total amount
System.out.println("total
electricity bill=" + total);
}
}
Sample
output:

Note: Read comments for better understanding of the Java code
Problem4 Java code:
import java.util.Scanner;
class WeekDays {
public static void main(String s[]) {
int day;
Scanner ss = new
Scanner(System.in);
System.out.println("Enter weekday
number"); // get weekday number from user
day = ss.nextInt();
switch (day) {
case 1:
System.out.println("Sunday");
break;
case 2:
System.out.println("Monday");
break;
case 3:
System.out.println("Tuesday");
break;
case 4:
System.out.println("Wednesday");
break;
case 5:
System.out.println("Thursday");
break;
case 6:
System.out.println("Friday");
break;
case 7:
System.out.println("Saturday");
break;
default:
System.out.println("Enter valid week day number");
break;
}
}
}
Sample output:

Note : I considered sunday as a day 1 and Saturday as day 7.
java programming language Problem3 (1.5 points). Write a Java program to input electricity unit charges and...
C programming help! Write a program that reads the electricity consumption (in kWh) and computes the electricity bill based on the following information: • The first 50 kWh costs 8.5 cents/kWh • Next 100 kWh costs 9.5 cents/kWh • Next 100 kWh costs 9.8 cents/kWh • The consumption above 250 kWh costs 10.25 cents/kWh Additional surcharge 20% is added to the bill. The input of the program is one integer and the output will be “The total bill is $?.”,...
JAVA PROGRAMMING LANGUAGE!!!! Pig Latin Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of Pig Latin, you convert a word by removing the first letter, placing that letter at the end of the word, and then appending "ay" to the word. Here is an example: English: I SLEPT MOST OF THE NIGHT Pig Latin : TAY LEPTSAY OSTMAY FOÀY HETAY 1GHTNAY make sure that there are two...
Programming Language is Java Lab 1: Programming Exercises Input/Process/Output 1) Run the Numbers. Write a program with two input values. The program should display the sum, difference, quotient, product, and average of the two numbers. 2) Jake’s Problem. Jake has a car with an 8-gallon fuel tank. Jake fills his tank with gas and drives 60 miles to a friend’s house. When he gets to his friend’s house, he has 6 gallons left in his fuel tank. Write a program...
Write a Java program that implements the number guessing game where the computer tries to guess a number in your head. You pick a number between 0 and 100, and the computer generates a guess. You then type 1 if your number is larger than the computer’s guess, -1 if your number is smaller, and 0 if the number is correct. The computer should keep trying to guess the number by adjusting the guess based on your feedback (so if...
Java programming only Create a Java program that inputs a grade from the user. The grade input from the user will be an integer. Once the input is stored, use an if-else-if block of code to determine the letter grade of the inputted integer grade. Do not use a bunch of if statements by themselves to solve this problem. You will print an error message for inputs greater than 100 and for inputs less than 0. Both errors must be...
Programming Assignment Objective Write a Java program that utilizes multiple classes. Write a Java program that utilizes inheritance in a practical manner. Problem: Quiz Bowl Your high school quiz bowl team has been losing its edge and needs to find a method to improve. Knowing that you are a savvy programmer, your coach asks you to write a program that the team members can use to hone their skills. Quiz Bowl questions come in three varieties: True/False Multiple Choice (variable...
*Java* Given the attached Question class and quiz text, write a driver program to input the questions from the text file, print each quiz question, input the character for the answer, and, after all questions, report the results. Write a Quiz class for the driver, with a main method. There should be a Scanner field for the input file, a field for the array of Questions (initialized to 100 possible questions), and an int field for the actual number of...
computer programming
Write a C program that will calculate and print monthly water bills. The total units consumed per month are derived from subtracting the previous meter readings with the current meter reading. The charges are calculated based on the rates stated in Table 2. The sample output is shown in Figure 16 Tulis aturcara Cyang akan mengira dan mencetak bil air bulanan Jumlah unit yang diguna sebulan dikira dengan menolak bacaan meter sebelum dengan bacaan meter terkinl. Caj dikira...
Plz help!! The programming
language is C and could you write comments as well?
Problem 2. Calculate Grades (35 points) Arrays can be used for any data type, such as int and char. But they can also be used for complex data types like structs. Structs can be simple, containing simple data types, but they can also contain more complex data types, such as another struct. So you could have a struct inside of a struct. This problem deals with...
Needs Help with Java programming language For this assignment, you need to write a simulation program to determine the average waiting time at a grocery store checkout while varying the number of customers and the number of checkout lanes. Classes needed: SortedLinked List: Implement a generic sorted singly-linked list which contains all of the elements included in the unsorted linked list developed in class, but modifies it in the following way: • delete the addfirst, addlast, and add(index) methods and...