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
Determine the Bcd equivalent 1100111110101001
Vilka [71]

Answer:

01010011000101100001

Explanation:

In computing and electronic systems, a binary-coded decimal (BCD) is a digital encoding method for decimal numbers in which each digit is represented by its own binary sequence.

8 0
2 years ago
What is the difference between the animation with shape hints and the animation without the shape hints?
soldier1979 [14.2K]
Animation with shape is 3D animation
Animation without shape is 2D animation
4 0
3 years ago
) What does sampling mean?
lubasha [3.4K]
In terms of music taking one song and incorporating it into your own song
6 0
2 years ago
A variable like user_num can store a value like an integer. Extend the given program as indicated. Output the user's input. (2 p
lapo4ka [179]

Answer:

The answer to this question is given below in the explanation section. It is noted that this program is written in C++ using online C++ compiler.

Explanation:

#include <iostream>

using namespace std;

int squared(int num)// this is the function to compute square

   {

       return num*num;

   }

int cube(int num)// this is the function to compute cube

   {

       return num*num*num;

   }

int main()

{

   int user_num, user_num2; // variable declaration

   

       cout<<"Enter the first number: ";//prompt user to enter the number

       cin>>user_num;//store the user entered number into variable

       cout<<"\nEnter the second number: ";//prompt the user to enter the second number

       cin>>user_num2;//store the user entered number into variable

   

   

   cout<<"\nSquared of first number is: "<<squared(user_num);//compute square of user_num and display

   cout<<"\nCube of first number is: "<<cube(user_num);//compute the cube of the user_num and display

   cout<<"\nSquare of second number is: "<<squared(user_num2);//compute the square of user_num2 and display

   cout<<"\nCube of second number is: "<<cube(user_num2);//compute the cube of user_num2 and display

   

   cout<<"\nSum of number 1 and number 2 is: "<<user_num2 + user_num2;//display the sum of user_num2 and user_num

   cout<<"\nProduct of number 1 and number 2 is: "<<user_num2 * user_num;//display the product of user_num and user_num2

   

   

   return 0;//terminate the program

}

                               

7 0
3 years ago
Which type of presentation is best for a presentation about the benefits of aerobic exercise?
insens350 [35]
Let's go with a Microsoft office power point presentation
7 0
3 years ago
Other questions:
  • Analyze a software application that enables people to purchase prescription drugs on the internet. briefly describe this applica
    14·1 answer
  • Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respect
    8·1 answer
  • Which type of image is not a supported using the Online Pictures or Insert Picture command?
    5·2 answers
  • Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
    11·1 answer
  • What is the function of a breadcrumb trail in a website?
    13·1 answer
  • Many digital libraries have much more information than traditional libraries
    13·1 answer
  • When hacking a website to test a secure connection and ensure internet safety, what is a good way to check the coding of the web
    14·1 answer
  • Stacy plans to print her contacts and would like to choose an option that will print select information for each contact in a bu
    12·1 answer
  • Does anyone know how to write this right? This is for a coding class and I’m super confused on it.
    13·1 answer
  • What is this line called that appears and disappears in the search box<br><br> WILL MARK BRAINLIEST
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!