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
g100num [7]
3 years ago
12

Write two statements to read in values for birthMonth followed by birthYear, separated by a space. Write a statement to print th

e date using the format birthMonth/birthYear. Ex: 1 2000 (User's input) 1/2000 (Program's output)
Computers and Technology
1 answer:
Ede4ka [16]3 years ago
5 0

Answer:

// here is code in the C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

// variable to store the input

int birth_month,birth_year;

cout<<"enter birth month:";

// read the birth month

cin>>birth_month;

cout<<"enter birth year:";

// read the birth year

cin>>birth_year;

// print the output

cout<<birth_month<<"/"<<birth_year<<endl;

return 0;

}

Explanation:

Declare two variables to store the birth month and birth year.Read the inputs from the user and assign it the variables.Print the birth month and year separated by a slash "/".

Output:

enter birth month:1                                                                                                        

enter birth year:2000                                                                                                      

1/2000

You might be interested in
PLS HELP subject (Microsoft Excel ) True or False:
RSB [31]
Hi! I'm Kofi, the answer bot. And here's the answer.

Yes, excel displays a red circle around any cells that contain invalid data. All cells that don't meet their data validation vriteria are ccircled, including values that were typed, copid, or filled in the cells, calulated by formulas, or entered by mycros.

Happy Learning! Mark me as a brainliest, thank you!
8 0
2 years ago
Original phone call greeting for oncologist
antoniya [11.8K]
No clue hjhfgjsksjnwidjwbe
8 0
3 years ago
What does WYSIWYG mean?
ch4aika [34]
This is a computer programmer's acronym for "what you see is what you get<span>."</span>
3 0
3 years ago
Read 2 more answers
Difference between first and second generation of computers. <br>​
Harman [31]

\mathcal{\fcolorbox{black}{orange}{\pink{Question:}}}

Difference between first and second generation of computers.

\mathcal{\fcolorbox{black}{orange}{\red{Answer:}}}

Refer to attachment.!

<h3>Hope It's helped mate! :)</h3>

7 0
3 years ago
Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName, and who
never [62]

Answer:

Python Program:

if __name__ == '__main__':

   a = input("Enter Name: ")

   b = a.split()

   print(b[2] + ',' , b[0], b[1][0])

Explanation:

The input function will be used to prompt user to enter the name of the person. The person's name will be stored in variable a.

Let us assume that the user entered a name mentioned in the example, which is Pat Silly Doe, Now variable a = 'Pat Silly Doe'.

The function a.split() is used to split a string into a list. The splitting (by default) is done on the basis of white-space character. Therefore, a.split() will give a list

['Pat', 'Silly', 'Doe']

which will be later on stored in variable b.

We can use the subscript operator [] to access the values in a list. Suppose if we have a list a, then a[i] will give us ith element of a, if i < length of a.

Finally, we print the answer. b[2] will give us the last name of the person. We append a comma using '+' operator. b[0] will give us the first name. b[1] will give us the middle name, but since we only need one character from the middle name, we can use another subscript operator b[1][0] to give us the first character  of the middle name.

Note: Characters of strings can be accessed using subscript operator too.

4 0
4 years ago
Other questions:
  • The process of converting information, such as text, numbers, photos, or music, into digital data that can be manipulated by ele
    7·1 answer
  • How to Ctrl + shift + F4 but in a HP laptop?​
    8·2 answers
  • Assume that we are using 0-1 integer programming model to solve a capital budgeting problem and xj = 1 if project j is selected
    6·2 answers
  • Consider having three String variables a, b, and c. The statement c = a + b; also can be achieved by saying_____________.a. c =
    11·1 answer
  • Complete the statement pertaining to the number of frames used by the national television system committee. The national televis
    9·1 answer
  • A0domain indicates that the computer or DNS name does not exist.
    7·1 answer
  • Which of the following choices best completes the above flowchart?
    11·1 answer
  • In the Microsoft Office Suite, what tells a database what to insert information in the document? 
    8·1 answer
  • Misspelet errors are displays with a ...<br>.. below them<br>​
    10·1 answer
  • Which tools do meteorologists use to collect data about the weather?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!