1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
timofeeve [1]
2 years ago
7

Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and

the year. End with newline. The program will be tested with inputs 1 2000, and then with inputs 5 1950. Ex: If the input is 1 2000, the output is:
Computers and Technology
1 answer:
Montano1993 [528]2 years ago
5 0

Answer:

1/2000

Explanation:

import java.util.Scanner;

public class InputExample {

public static void main(String [] args) {

Scanner scnr = new Scanner(System.in);

System.out.print("Enter birth month and date:");//comment this line if not needed

int birthMonth=scnr.nextInt();

int birthYear=scnr.nextInt();

String output= birthMonth+"/"+birthYear+"\n";

System.out.println(output);

}

}

if using this code the out put should be 1/2000

You might be interested in
Write a program to calculate the great circle distance between two points on the surface of a sphere. If p1(x1, y1) and p2(x2,y2
Tamiku [17]

Answer:

import java.lang.*;

public class distance { public static double distance(double latitude1,

                                     double latitude2, double longitude1,

                                     double longitude2)

       {

      // Convert Latitude and Longitude to Radians

           longitude1 = Math.toRadians(longitude1);

           longitude2 = Math.toRadians(longitude2);

           latitude1 = Math.toRadians(latitude1);

           latitude2 = Math.toRadians(latitude2);

           

           double d_longitude = longitude2 - longitude1;

           double d_latitude = latitude2 - latitude1;

           double a = Math.pow(Math.sin(d_latitude / 2), 2)

                   + Math.cos(latitude1) * Math.cos(latitude2)

                   * Math.pow(Math.sin(d_longitude / 2),2);

           double val = 2 * Math.asin(Math.sqrt(a));

           // Radius of earth in kilometers is 6371

           double earth_radius = 6371;

           // Calculate and return the distance

           return(val * earth_radius);

       }

       // Main Method

       public static void main(String[] args)

       {

           double latitude1 = 67.32055555555556;

           double latitude2 = 83.31861111111111;

           double longitude1 = -1.7217899;

           double longitude2 = -1.6567799;

           System.out.println(distance(latitude1, latitude2,

                   longitude1, longitude2) + " K.M");

       }

   }

Explanation:

This program is implemented in Java programming language

The formula for the shortest distance between two points on the earth is:

Distance = 3963.0 * arccos[(sin(lat1) * sin(lat2)) + cos(lat1) * cos(lat2) * cos(long2 – long1)]

The latitude and longitude of the two points must be known

The latitude and longitude are converted into radians using built in methods in java.

Take value for the radius of the earth in Kilometers  6371;

Note that a seperate method has been created to calculate the distance

In the driver method (main), values for latitude and logitudes for both places have been hard-corded, then the method distance is called and passed those values

Note also that the distance has been calculated in Kilometers

8 0
3 years ago
Rerouting traffic using arp poisoning is an attack on ________ of a network.
Arada [10]
Rerouting traffic using ARP poisoning is an attack on both the functionality  and confidentiality of a network. This is also known as ARP spoofing. This type of attack takes a legitimate IP address of another host and causes traffic redirection to an infected page. 
5 0
3 years ago
what will be the Trade discount and Invoice Amount if the List Price is $400.00 and the Trade Discount Rate is 85%
V125BC [204]

Answer:

$340

Explanation:

you have to multiply $400 bu 85% to get $340

4 0
2 years ago
You write a short story, but you want to make sure your work is protected before you post it online. What should you do to help
Mars2501 [29]
Make sure you but no copyright, author, and date of publication, that may help.
8 0
3 years ago
Select the correct answer.
snow_tiger [21]

Answer: I think it's D.

Explanation: I'm sorry if I chose the wrong answer, I'm not too good with stuff like this.

3 0
2 years ago
Other questions:
  • If there are no differences between the amino acid sequences in the cytochrome c protein of humans and chimpanzees why aren't we
    15·1 answer
  • A cell reference that has only one $ is referred to as a(n) ____ cell reference. alternative mixed relative absolute
    7·1 answer
  • 1. [2 points] Write a function to compute the volume of a sphere, given its radius. 2. [2 points] Write a recursive function to
    7·1 answer
  • What is meant by backing up files through cloud computing?
    5·2 answers
  • How many hosts are in each subnet?
    15·1 answer
  • When the CSS property of position is set to ____ it moves the element relative to its original position and allows other element
    10·1 answer
  • Special words are those words that start and end with the same letter. [14]
    12·1 answer
  • In an URL what does the domain name describe?
    14·1 answer
  • I am bad with excell pleasee heelp
    15·1 answer
  • What are three coding languages that are used to build websites?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!