Answer:
// Here is SammysRentalPrice.java file
// import package
import java.util.*;
// class definition
class SammysRentalPrice
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// object to read value from user
Scanner scr=new Scanner(System.in);
// ask to enter rented minutes
System.out.print("enter rented minutes: ");
// read minutes
int min=scr.nextInt();
// find hours
int hour=min/60;
//reamining minutes
min=min%60;
// total cost
int cost=hour*40+min*1;
// print cost
System.out.println("total cost is: "+cost);
}catch(Exception ex){
return;}
}
}
Explanation:
Read rented minutes from user and assign it to variable "min".Find the hours from minutes and then update the remaining minutes.After this multiply hours with 40 and remaining minutes with 1.Sum them and this will be the cost of rented a sports equipment.
Output:
enter rented minutes: 145
total cost is: 105
The fastest way to transfer a good file to the computer is Use the C$ administrative share to copy the file.
<h3>How do I copy a file?</h3>
To copy a file, right-click on the desired file and select Copy. Alternatively, you can use the keyboard shortcut. To copy the item: click Ctrl+C. Navigate to the folder you want to move or copy the item to and click Ctrl+V or right-click and select paste.
To automatically paste the text, you will be inserting the copied content, which is in the clipboard to the desired location by the user, since such an operation only works if something has previously been copied or cut.
See more about copy a file at brainly.com/question/18241798
#SPJ1
Answer:
import java.util.Scanner;
public class num4 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int sumOdds =0;
int sumEvens =0;
int num;
do{
System.out.println("Enter positive integers");
num = in.nextInt();
if(num%2==0){
sumEvens+=num;
}
else if (num%2!=0){
sumOdds+=num;
}
}while (num>0);
System.out.println("The sum of evens: "+sumEvens);
System.out.println("The sum of odds: "+sumOdds);
}
}
Explanation:
- Import Scanner class to prompt and receive user input
- Declare the following variables and initialize them int sumOdds =0, int sumEvens =0, int num;
- Create a do....while loop That continously prompts user to enter a positive number. The loop should terminate when a negative number is enters (n<=0)
- Within the while loop use an if condition with the modulo (%) operator to determine even and odd numbers and add to the respective variables
- Outside of the while loop Print sum of odds and sum of evens
Answer:
i mean, theres not much strategy to the game at all, its just being able to shoot from hard spots, and obviously have good consistentsy
Explanation:
If the bully did not first befriend the person, it’s outing. If he did, then it’s trickery.