Question

In [19]: System.out.printf(%3s%85\n, Day, Index); System.out.printf(===========\n); for (int i = 0; i < days.length;

0 0
Add a comment Improve this question Transcribed image text
Answer #1
public class DaysArray {
    public static void main(String[] args) {
        String days[] = {"sun","mon","tuw","wed","thu","fri","sat"};
        System.out.printf("%3s%8s\n","Day","Index");
        System.out.printf("===========\n");
        int i = 0;
        while(i<days.length)
        {
            System.out.printf("%3s%8s\n",days[i],i);
            i++;
        }
    }
}
Add a comment
Know the answer?
Add Answer to:
In [19]: System.out.printf("%3s%85\n", "Day", "Index"); System.out.printf("===========\n"); for (int i = 0; i < days.length; i++) {...
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
  • A local franchise of a national chain of day-old pastry stores recorded the number of customers that came in to the store for five weeks this fall. The national franchisor states that the percentage o...

    A local franchise of a national chain of day-old pastry stores recorded the number of customers that came in to the store for five weeks this fall. The national franchisor states that the percentage of customers is distributed as follows: Sunday – 20%, Monday – 8%, Tuesday – 6%, Wednesday – 7%, Thursday – 12%, Friday – 22%, Saturday – 25%. The manager doesn’t trust the franchisor and wants to show his store has different percentages. Use a χ² Goodness-of-Fit...

  • A local franchise of a national chain of day-old pastry stores recorded the number of customers that came in to the store for five weeks this fall. These data are recorded in the attached file. The na...

    A local franchise of a national chain of day-old pastry stores recorded the number of customers that came in to the store for five weeks this fall. These data are recorded in the attached file. The national franchisor states that the percentage of customers is distributed as follows:   Sunday – 20%, Monday – 8%, Tuesday – 6%, Wednesday – 7%, Thursday – 12%, Friday – 22%, and Saturday – 25%. The manager doesn’t trust the franchisor and wants to show...

  • Given the following enumeration, what is the output from the printf(): enum day { sun, mon,...

    Given the following enumeration, what is the output from the printf(): enum day { sun, mon, tue, wed, thu, fri, sat}; enum day d; d = mon; prrintf("%d\n", d); a. mon b. 1 c. MON d. 0

  • Help with Python problem. ###################################### Q3 ############################### dowt = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat')...

    Help with Python problem. ###################################### Q3 ############################### dowt = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') # day-of-week-tuple, # year = 2020 cnt = 3 # 2020/1/1 is a Wednesday, so let us start a counting index of 3 for Wednesday, and keep adding one # m = 3 # this will be a variable to be looped through eventually. I use the convention of 0–11 for the twelve months # # As the cnt value changes, we want to...

  • I need help how to do the steps 9, 10, 11 A1 x Day A fx...

    I need help how to do the steps 9, 10, 11 A1 x Day A fx B C D E F G H I J K Afternoon Sales over $100 Shift Cups Sold Kids Sold Kids sold Cups sold (6 oz) (12 oz) 54 52 14 28 Hours Morning Afternoon Evening 1 Day 2 Sun 3 Sun 4 Mon 5 Mon 6 Tue 7 Tue 8 Wed 9 Wed | 10 Thu | 11 Thu 12 Fri 13 Fri 14...

  • c++ please :) First, ask the user to enter a year (4-digit) and what week day...

    c++ please :) First, ask the user to enter a year (4-digit) and what week day does this year starts with (String) For example, the year 2018 starts with the week day "Friday". In this case, the calendar should start from January 1 which is Friday, 2018 Your program should produce a formatted calendar for the specified year and there should be a blank line after each month. Moreover, the month and the year should be centered over each month....

  • Heavenly Chocolates manufactures and sells quality chocolate products at its plant and retail store located in...

    Heavenly Chocolates manufactures and sells quality chocolate products at its plant and retail store located in Saratoga Springs, New York. Two years ago, the company developed a Web site and began selling its products over the Internet. Web site sales have exceeded the company’s expectations, and management is now considering strategies to increase sales even further. To learn more about the Web site customers, a sample of 50 Heavenly Chocolate transactions was selected from the previous month’s sales. Data showing...

  • In C programming. How do you build a calendar? I can't get the days to work...

    In C programming. How do you build a calendar? I can't get the days to work right. This is what I have so far #include <stdio.h> #include <string.h> #include <stdlib.h> int dow(int year, int month, int day) {     static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};     year -= month < 3;     return (year + year/4 - year/100 + year/400 + t[month-1] + day) % 7; } int main() {...

  • Can someone fix my coding please it's a calendar some days are placed wrong. I just...

    Can someone fix my coding please it's a calendar some days are placed wrong. I just want the Main menu to display first and second option and four option to end the program properly. Please remove option number 3 Find the number of days between 2 selected dates and the code that belongs to this function. #include<stdio.h> void days(int,int,int,int,int,int); int month(int,int); int mon[12]={31,28,31,30,31,30,31,31,30,31,30,31}; #define TRUE 1 #define FALSE 0 int days_in_month[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; char *months[]= { " ", "\n\n\nJanuary", "\n\n\nFebruary", "\n\n\nMarch", "\n\n\nApril",...

  • Write a C# program that prints a calendar for a given year. Call this program calendar....

    Write a C# program that prints a calendar for a given year. Call this program calendar. The program prompts the user for two inputs:       1) The year for which you are generating the calendar.       2) The day of the week that January first is on, you will use the following notation to set the day of the week:             0 Sunday                     1 Monday                   2 Tuesday                   3 Wednesday       4 Thursday                 5 Friday                      6 Saturday Your program should...

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