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
DerKrebs [107]
3 years ago
14

Write a program that asks the user to enter a birth year. the program should then indicate which generation a person of that yea

r belongs to. g
Computers and Technology
1 answer:
USPshnik [31]3 years ago
7 0
Something like the following. Also you need to give what language you are using. Anyways, you should be able to convert this to your language of choice. 

<script type="text/javascript">
function checkGeneration() { 
   var gen = ["Baby Boomer ","Generation X","Xennials","Generation Y"];
   var reversestr = "";
   var getyear = window.prompt("Enter a 3 digit number: ");
    if (parseInt(getyear) <= 1964) {
        alert(gen[0]);   
    } else if(parseInt(getyear) <= 1979) {
        alert(gen[1]);
    } else if(parseInt(getyear) <= 1985) {
        alert(gen[2]);               
   }  else if(parseInt(getyear) <= 1995) {
        alert(gen[3]);
   }
 }
checkGeneration();
</script>
You might be interested in
Which statement is used to create a file object that will append data to an existing file? BufferedWriter salesdata =
Temka [501]

Answer:

BufferedWriter salesdata = new BufferedWriter(new FileWriter("out.dat", true);.

Explanation:

  • The statement BufferedWriter salesdata = new BufferedWriter(new FileWriter("out.dat", true); can be used to create a file object that will append data to an existing file.
  • Here, BufferedWriter class is used to create text from an output stream.
  • Here, FileWriter is used to create the file from the text. The constructor for FileWriter is FileWriter (String filename, boolean append).
  • Here, filename is string ("out.dat") is provided and the append is boolean can be either true (if the text has to be appended at the end of the file) or false (if the text hasn't to be appended at the end of the file).
  • So, option (b) is correct.
  • Option (a) is not correct as it indicates the text shouldn't be appended at the end of the file as the boolean is false.
  • Option (c) is not correct as it doesn't mean to append as there is no boolean true indicated in the constructor.
  • Option (d) is not correct as there is not such kind of syntax.

8 0
4 years ago
Read 2 more answers
In Interactive Charting, which chart type allows you to chart the current spread between a corporate bond and a benchmark govern
harkovskaia [24]

Answer:

c. Bond Spread

Explanation:

An interactive chart is used to show all the details in the chart and the user can extend or shrink the details that is presented in the charts by using the slider control.

The bond spread in an interactive is a chart that is used to compare and chart the current spread between the corporate bond as well as the benchmark government bond.

8 0
3 years ago
We have said that an application may choose UDP for a transport protocol because UDP offers finer application control (than TCP)
jolli1 [7]

Answer:

UDP has more control as compare to TCP in terms of data and time.

a. In terms of data, an application has more control in UDP as compare to TCP, in terms of confidentiality and security of Data. As UDP use the process of encapsulation to secure the information, this will cause that UDP will know that what data is sent.

b. UDP has the ability to control the flow of data and traffic congestion control, while TCP has no congestion control which causes extra delays in application. Due to this reason UDP has better control over time to send the data.

<em>We can say that, UDP has better control than TCP.</em>

4 0
3 years ago
Tin học đã làm thay đổi công tác văn phòng ngày nay như thế nào?
vlabodo [156]
Công nghệ đã thay đổi cách mọi người sử dụng để giao tiếp ở nơi làm việc hiện đại
6 0
3 years ago
Suppose a linked list of 20 nodes. The middle node has a data –250. Write the pseudocode to replace the middle node of the linke
dexar [7]

Answer:

The middle node has a data –250. ... Write The Pseudocode To Replace The Middle Node Of The Linked List With ... Assume That The List's Head Pointer Is Called Head_ptr And The Data For The New Node Is Called Entry ... Assume that the list's head pointer is called head_ptr and the data for the new node is called entry ...

Explanation:

4 0
4 years ago
Read 2 more answers
Other questions:
  • To resize an embedded chart, ____. select one:
    5·1 answer
  • One way to avoid carbon monoxide poisoning is to:<br><br> B. Open a rear window in your car
    9·1 answer
  • Which examples are relevant sources for students to use in research?
    6·1 answer
  • What type of data would a RDBMS store in a linked list, two-way linked list, or B-trees? What are the advantages and disadvantag
    5·1 answer
  • What is the process that creates a shortcut on your taskbar?
    14·2 answers
  • Change 'What do they do' into passive voice​
    9·2 answers
  • Why can it be helpful to perform mathematical calculations using programming? Choose the best answer.
    11·1 answer
  • Which of the following statements best describes the relative amount of content held by digital libraries vs. the amount held by
    15·1 answer
  • which option dexcribes a situation when asexual reproduction would be more advantageous to an organism?
    14·1 answer
  • 3- It is an Information page that is displayed through one of the Internet browsers, it can be saved along htm, html page.
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!