Question

BIRTHDAY GRAPH5 4B Input Standard input Output Standard output Topic Array & Array Processing Birthday Graph Problem Descript

Java code

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Working code implemented in Java and appropriate comments provided for better understanding:

Source code for BirthdayGraph.java:

import java.util.Scanner;

public class BirthdayGraph {

   public static void main(String[] args) {
       // TODO Auto-generated method stub
      
       Scanner sc = new Scanner(System.in);
      
       int N;
       N = sc.nextInt();
      
       if (N>0 && N<=100){

           int x = 1;
          
           while (N != 0){
              
               if (N!=0){
                  
                   int [] arr = new int[N];
                   for (int a=0; a<N; a++){
                       int dd = sc.nextInt();
                       arr [a]= sc.nextInt();
                       int yyyy= sc.nextInt();
                   }
                  
                   System.out.println("Case #"+x+":");
                  
                   for (int b=0; b<12; b++){
                       if(b==0){
                           System.out.print("Jan:");
                       }
                       else if(b==1){
                           System.out.print("Feb:");
                       }
                       else if(b==2){
                           System.out.print("Mar:");
                       }else if(b==3){
                           System.out.print("Apr:");
                       }else if(b==4){
                           System.out.print("May:");
                       }else if(b==5){
                           System.out.print("Jun:");
                       }else if(b==6){
                           System.out.print("Jul:");
                       }else if(b==7){
                           System.out.print("Aug:");
                       }else if(b==8){
                           System.out.print("Sep:");
                       }else if(b==9){
                           System.out.print("Oct:");
                       }else if(b==10){
                           System.out.print("Nov:");
                       }else if(b==11){
                           System.out.print("Dec:");
                       }
                      
                   for(int c=0; c<N; c++){
                       if(arr[c]==(b+1)){
                           System.out.print("*");
                       }
                   }
                   System.out.println();
                   }
                  
                   N = sc.nextInt();
          
                   x++;
              
               }
           }
       }
      
       sc.close();
   }

}

Sample Output Screenshots:

Hope it helps, if you like the answer give it a thumbs up. Thank you.

Add a comment
Know the answer?
Add Answer to:
Java code BIRTHDAY GRAPH5 4B Input Standard input Output Standard output Topic Array & Array Processing...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Code with Java using arrays and Scanner only ( input should end with 0 to terminate...

    Code with Java using arrays and Scanner only ( input should end with 0 to terminate the program) Everyone loves to be celebrated on their birthdays. Birthday celebration can encourage positive social interaction among co-workers, foster friendship among classmates or even strengthen bond between families. Birthday graph can be display in many forms. It can a creative drawing consists of cupcakes, balloons, candles with names, or it can be in the form of simple bar chart to indicate the birthday...

  • Java code ABOVE AVERAGE 40 Input Standard input Output Standard output Topic Array & Array Processing...

    Java code ABOVE AVERAGE 40 Input Standard input Output Standard output Topic Array & Array Processing Problem Description Understanding how to interpret test scores is a valuable skill for every teacher. That's because test score interpretation enables teachers to understand how their students' performance for each tests of the course. Average test score is one of the indicators to determine the class performance for the test. For each test, we need to calculate the average score and determine the percentage...

  • Java code INNER PRODUCT 4E Input Standard input Output Standard output Topic Array & Array Processing!...

    Java code INNER PRODUCT 4E Input Standard input Output Standard output Topic Array & Array Processing! Problem Description The inner product (also known as the dot product or scalar product) of the elements of set A and the elements of set B of size is defined as the sum of the products of corresponding terms. For example, given set A as the array (2, 3, 4, 5, 6, 7, 8, 9; and set B as 6,5, 4, 3, 2, 7,...

  • Java code COCONUT KELAPA4 4A. Input Standard input Output Standard output Topic Array & Array Processing...

    Java code COCONUT KELAPA4 4A. Input Standard input Output Standard output Topic Array & Array Processing Problem Description Ali Wali owns a coconut plantation and a number of monkeys for bringing down coconuts. Every day, Ali would record the number of coconuts brought down by his monkeys. At the end of a certain time period, he would determine from the data recorded, the lowest and the highest number of coconuts as well as their number of occurrences. Write a program...

  • What is the major product for each reaction? Could you please draw the mechanism? JAN FEB...

    What is the major product for each reaction? Could you please draw the mechanism? JAN FEB MAR APR MAY 01 02 03 04 05 06 07 08 09 10 11 12 13 JUN 14 15 16 JUL AUG SEP O 17 18 19 20 21 22 23 24 25

  • matlab 28 pts Question 8 Problem 4. Write the following function. Do NOT hard code using...

    matlab 28 pts Question 8 Problem 4. Write the following function. Do NOT hard code using any of the examples. Your function should work for all possible inputs as specified by the problem. Hard coding will result in significant point loss. (B) (28 Points) Function Name: birthday Party Input (2): (char) An Mx 11 array formatted with information about various birthdays (char) An MxN array of names Output (l): (char) A string containing information about the best birthday Function Description:...

  • Date Gasoline Crude Oil Jan 01, 2010 2.031 79.07 Jan 08, 2010 2.124 82.34 Jan 15,...

    Date Gasoline Crude Oil Jan 01, 2010 2.031 79.07 Jan 08, 2010 2.124 82.34 Jan 15, 2010 2.079 80.06 Jan 22, 2010 2.010 76.62 Jan 29, 2010 1.942 73.94 Feb 05, 2010 1.885 74.57 Feb 12, 2010 1.908 73.88 Feb 19, 2010 2.031 78.25 Feb 26, 2010 2.042 79.22 Mar 05, 2010 2.127 80.19 Mar 12, 2010 2.154 81.76 Mar 19, 2010 2.150 81.44 Mar 26, 2010 2.118 80.65 Apr 02, 2010 2.191 83.01 Apr 09, 2010 2.238 85.66 Apr...

  • I need the answer to #2 listed above. This is the code I have come up...

    I need the answer to #2 listed above. This is the code I have come up with, and it is wrong. I am new to this and need help. group by sust.cida Q2 (7 Points) Show customer id (CID) for customers who have spent 30,000 or more with the company in 2019. Money is considered "spent" when the entire work order is completed as recorded in workorder.completionDate. (Correct query will find customer 2). Use ONE SQL statement. select workarder.id from...

  • Estimate the 100-year flood discharge and gauge height for Spring Creek in Houserville using the data...

    Estimate the 100-year flood discharge and gauge height for Spring Creek in Houserville using the data provided. First, calculate the Rank (1 being the flood with the greatest discharge) and Recurrence Time, using the formula RT-(n+1) m is the number of yearly peak flood data- 20 in this case, and m is the rank of the peak discharge), filling in the results for the table below. Rank Recurrence Time Discharge (cfs) 318 687 440 351 476 Year 1985 196 1987...

  • Write a C++ program that will input data from a Comma-separated values (.csv) file and output som...

    Write a C++ program that will input data from a Comma-separated values (.csv) file and output some information about it. This program uses a csv file from Yahoo Finance (.csv) filename : SBUX.csv 1. Output the name of the ticker to the console screen (without the “.csv”) 2. Output the start date and end date that was found in the file 3. Output how many trading day(s) existed in the file 4. Prompt the use to input a number of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT