Write two cin statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a dash, 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 Note: The input values come from user input, so be sure to use cin statements, as in cin >> birthMonth, to get those input values (and don't assign values directly as in birthMonth

Respuesta :

Answer:

// here is code in c++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

// variables to read birth month and year

int birthMonth,birthYear;

cout<<"Enter the birth month:";

// read the birth month

cin>>birthMonth;

cout<<"Enter the birth Year:";

// read the birth year

cin>>birthYear;

// print the output

cout<<birthMonth<<"-"<<birthYear<<endl;

return 0;

}

Explanation:

Declare two variables "birthMonth" and "birthYear". Read the value of birthMonth and birthYear from user. Then print the birth month and birth year and a dash(-) in between them.

Output:

Enter the birth month:1                                                                                                                                      

Enter the birth Year:2000                                                                                                                                    

1-2000  

Enter the birth month:5                                                                                                                                      

Enter the birth Year:1950                                                                                                                                    

5-1950

The program is an illustration of a sequential program, and it does not require loops, iterations or conditions.

The programming statements in C++, where comments are used to explain each line is as follows:

//This gets input for birthMonth

cin>>birthMonth;

//This gets input for birthYear

   cin>>birthYear;

// This prints the month, a dash, and the year

   cout<<birthMonth<<"-"<<birthYear;

Read more about similar programs at:

https://brainly.com/question/15187402