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
Nookie1986 [14]
3 years ago
5

Write two scnr.nextInt 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: 1/2000
Computers and Technology
1 answer:
Firlakuza [10]3 years ago
7 0

Answer:

Here is code in Java.

// import package

import java.util.*;

class Main

{   // main method of class

public static void main (String[] args) throws java.lang.Exception

{

   try{

       // variables to store the input

       int birthMonth,birthYear;

       // Scanner class object to read the input

       Scanner scnr=new Scanner(System.in);

       System.out.print("Please enter the birth month:");

       // read the birth month

       birthMonth=scnr.nextInt();

       System.out.print("Please enter the birth year:");

       // read the birth year

       birthYear=scnr.nextInt();

       // print the output

       System.out.println(birthMonth+"/"+birthYear+"\n");

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create two variables "birthMonth" & "birthYear" to store the birth month and birth year.Read the  values of both from user. Print the birth month and birth year separated by a slash("/").

Output:

Please enter the birth month:1                                                                                                

Please enter the birth year:2000                                                                                              

1/2000  

Please enter the birth month:5                                                                                                

Please enter the birth year:1950                                                                                              

5/1950  

You might be interested in
22. The Disc Drive is also known as the:
andrew11 [14]

Answer:

HDD Hard Disk Drive

Explanation:

3 0
3 years ago
Select the correct answer from each drop-down menu.
DerKrebs [107]

Answer:

?

Explanation:

?!?!

3 0
3 years ago
Bryan knows that it takes him fifteen minutes to drive to work, or twenty minutes if every traffic light is red on the way there
lisabon 2012 [21]
<span>The answer is "punctuality"; Being on time is respectful to your co-workers and to the organization and is a good workplace habit. It is a sign to others of your reliability, that they can depend on you. Their are many positive that come from is habit, such as clients knowing they can reach someone, or morning meetings that are more productive, or colleagues who are are more efficient not having to cover for you until you arrive.</span>
5 0
4 years ago
Read 2 more answers
Write the class definition for a class named Employee. The class should include data members for an employee object%u2019s name
kykrilka [37]

Answer:

see explaination

Explanation:

#include <iostream>

#include <string>

using namespace std;

class Employee

{

string name;

int salary;

public: Employee()

{

}

Employee(string name, int salary)

{

this->name=name;

this->salary=salary;

}

void setName(string name)

{

this->name=name;

}

void setSalary(int sal)

{

this->salary=sal;

}

string getName()

{

return name;

}

int getSalary()

{

return salary;

}

void raiseSalary(int percentage)

{

if(percentage<0)

{

cout<<"Invalid percentage";

}

else

{

salary=salary+((float)percentage/100)*salary;

}

}

};

int main()

{

int percentage;

Employee e1("Satur",1000);

cout<<"Employee details are:";

cout<<e1.getName();

cout<<e1.getSalary();

cout<<"Enter the percentage raise";

cin>>percentage;

e1.raiseSalary(percentage);

cout<<"Raise in salary:";

cout<<e1.getSalary();

return 0;

}

7 0
3 years ago
Help i give 20 shekel
Verdich [7]

Answer:hacking a computer is all I know

Explanation:

8 0
3 years ago
Other questions:
  • Alonzo collects bugs. He has created a fascinating display of large insects. Collecting bugs is a(n) _____ to Alonzo.
    10·2 answers
  • How do I convert a number into a percentage in excel
    7·1 answer
  • ____ allow us to store a binary image in code. (1 point)
    9·1 answer
  • Which question best helps a reader understand a plot’s exposition? What will life be like after the character takes action? How
    14·2 answers
  • My programming lab 9.2 C++ Write a full class definition for a class named Counter, and containing the following members:_______
    6·1 answer
  • Sam needs to create a spreadsheet for his coworkers. They will need to follow across a long row of data. Sam would like to make
    8·2 answers
  • What does it mean when you mail is labled unable to forward for review
    5·1 answer
  • What is a compiler? O a tool used to integrate multiple software programs O a tool used to extract a single software program fro
    13·2 answers
  • Which of the following is the best example of an installation issue
    11·2 answers
  • Lists Five Examples of simple statement<br>​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!