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
EleoNora [17]
3 years ago
10

Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o

r "feb or "mar" or "apr" or "may" or "jun" or "jul" or "aug" or "sep" or "oct" or "nov" or "dec" based on the value of month. (So, if the value of month were 4 then the value of the expression would be "apr".).Again, conditional operator so I need to : and ? .(month==1)?"jan":(month==2)?"feb": (month==3)?"mar": (month==4)?"apr": (month==5)?"may":(month==6)?"jun": (month==7)?"jul":(month==8)?"aug":(month==9)?"sep": (month==10)?"oct": (month==11)?"nov": (month==12)?"dec": isn't quite right for the compiler I am currently using.
Computers and Technology
1 answer:
Tamiku [17]3 years ago
7 0

Answer:

The code is given below

Explanation:

The correct syntax would be to place appropriate parenthesis.

(month==1?"jan":(month==2?"feb":(month==3?"mar":(month==4?"apr":(month==5?"may":(month==6?"jun":(month==7?"jul":(month==8?"aug":(month==9?"sep":(month==10?"oct":(month==11?"nov":"dec")))))))))));

Similarly, you can also use the following code:

String[] months = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };

int month = 1;

String monthDescription = months[month - 1];

You might be interested in
Which marketing strategy is represented by advertisers paying for online display ads?
e-lub [12.9K]

Answer:

The answer is (c) paid media

Explanation:

Because they are paying for the ad to be displayed online. hope this helps!

8 0
3 years ago
In NumPy, the_______
Nikolay [14]

Numpy is among the most prevalent science computer science bundles in Python, and the following are the discussion on the use of transpose function:

  • Transpose() is among the most important <em>matrix multiplication functions</em>.
  • It is used to changes elements of the <em><u>row into column</u></em> elements and the elements of the <em><u>column into rows</u></em> elements.
  • The output of this function is an original modified array.

Therefore, the transpose function in NumPy is being used to <em><u>switch positions of rows to columns or columns to rows</u></em>.

Learn more:

brainly.com/question/24763535

7 0
2 years ago
T is important to remember to print the return address when printing an
expeople1 [14]
Shipping label? Ggggggggggggg
6 0
3 years ago
A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
FrozenT [24]
That is false. are you doing it on a computer course.                                             <span />
3 0
3 years ago
Read 2 more answers
What parts of the computer does it not need to function?​
Thepotemich [5.8K]
Fancy lights, mouse, keyboard, you can do fan but the computer will eventually overheat, it need coolant for it to run for a long while
6 0
3 years ago
Other questions:
  • Which of the following assignment statements contains a LOGICAL error? I multiply two numbers when they need to be added I write
    9·1 answer
  • 1. Describe an application where a series circuit might work better than a parallel circuit
    11·2 answers
  • What type of change can AutoCorrect option make to a word?
    10·2 answers
  • When planning the structure of a spreadsheet, columns are for _______ items and rows are for _______ items.
    5·2 answers
  • Grace is the editor of her school newspaper. Which feature of a word processing program would she use to make her changes visibl
    7·2 answers
  • 3.19 LAB: Seasons In C++ Write a program that takes a date as input and outputs the date's season. The input is a string to repr
    15·1 answer
  • Applications of kinematics in computer engineering​
    7·1 answer
  • Program a substitution cipher in Python. Create 2 functions one for encryption and the other for decryption ( get the text as th
    8·1 answer
  • Hi I got a new phone and my photos are taking so long to download, on Friday it was at 13000 what do I do it’s taking so long
    14·1 answer
  • Drag each tile to the correct box.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!