Computer Science, asked by Ali123321, 6 months ago

Write a program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile: loan payment, insurance, gas, oil, tires, and maintenance. The program should then display the total monthly cost of these expenses, and the total annual cost of these expenses.

Answers

Answered by manuprajapati519
1

Answer:

import java.util.Scanner;

public class user

{

public static void main(String args[]);

{

Scanner in = new Scanner(System.in);

int l, i, g, o, t, m, sum, sum2;

System.out.println("Input your monthly expence");

l=in.nextInt();

i=in.nextInt();

g=in.nextInt();

o=in.nextInt();

t=in.nextInt();

m=in.nextInt();

sum=l+i+g+o+t+m;

sum2=l+i+g+o+t+m*365;

System.out.println("Here's your total monthly expence ="+sum);

System.out.println("Here's your total yearly expence ="+sum2);

}

}

Similar questions