Building Java Programs: A Back to Basics Approach (4th Edition)
Building Java Programs: A Back to Basics Approach (4th Edition)
4th Edition
ISBN: 9780134322766
Author: Stuart Reges, Marty Stepp
Publisher: PEARSON
bartleby

Videos

Question
Book Icon
Chapter 1, Problem 4PP

ChristmasSong Class

Program Plan Intro

Program plan:

  • Create the class “ChristmasSong”.
    • Define the “main()” function.
      • Create a string array named “arrLyrics” of size 12.
      • Initialize the array.
      • Create an integer “loopAmount”.
      • Iterate a “for” loop.
        • Create two string variables “day” and “dailyLyric”.
        • If the condition “i==1” is true.
          • Set “day” as “st”.
        • If the condition “i==2” is true.
          • Set “day” as “nd”.
        • If the condition “i==3” is true.
          • Set “day” as “ed”.
        • If the condition “i==4” is true.
          • Set “day” as “th”.
        • Set the variable “dailyLyric” with the string in “arraLyrics[0]”.
        • Print the value of “dailyLyric”.
        • Execute switch cases.
          • If “i” is “12”.
            • Print the value of “arrayLyrics[12]”.
              • If “i” is “11”.
                • Print the value of “arrayLyrics[11]”.
              • If “i” is “10”.
                • Print the value of “arrayLyrics[10]”.
              • If “i” is “9”.
                • Print the value of “arrayLyrics[9]”.
              • If “i” is “8”.
                • Print the value of “arrayLyrics[8]”.
              • If “i” is “7”.
                • Print the value of “arrayLyrics[7]”.
              • If “i” is “6”.
                • Print the value of “arrayLyrics[6]”.
              • If “i” is “5”.
                • Print the value of “arrayLyrics[5]”.
              • If “i” is “4”.
                • Print the value of “arrayLyrics[4]”.
              • If “i” is “3”.
                • Print the value of “arrayLyrics[3]”.
              • If “i” is “2”.
                • Print the value of “arrayLyrics[2]”.
              • If “i” is “1”.
                • Print the value of “arrayLyrics[1]”.
                • Print a new line.
                • Break from switch case.

Blurred answer
Students have asked these similar questions
I cannot program smart home automation rules from my device using a computer or phone, and I would like to know how to properly connect devices such as switches and sensors together ? Cisco Packet Tracer 1. Smart Home Automation:o Connect a temperature sensor and a fan to a home gateway.o Configure the home gateway so that the fan is activated when the temperature exceedsa set threshold (e.g., 30°C).2. WiFi Network Configuration:o Set up a wireless LAN with a unique SSID.o Enable WPA2 encryption to secure the WiFi network.o Implement MAC address filtering to allow only specific clients to connect.3. WLC Configuration:o Deploy at least two wireless access points connected to a Wireless LAN Controller(WLC).o Configure the WLC to manage the APs, broadcast the configured SSID, and applyconsistent security settings across all APs.
using r language for integration theta = integral 0 to infinity (x^4)*e^(-x^2)/2 dx (1) use the density function of standard normal distribution N(0,1) f(x) = 1/sqrt(2pi) * e^(-x^2)/2 -infinity <x<infinity as importance function and obtain an estimate theta 1 for theta set m=100 for the estimate whatt is the estimate theta 1? (2)use the density function of gamma (r=5 λ=1/2)distribution f(x)=λ^r/Γ(r) x^(r-1)e^(-λx) x>=0 as importance function and obtain an estimate theta 2 for theta set m=1000 fir the estimate what is the estimate theta2? (3) use simulation (repeat 1000 times) to estimate the variance of the estimates theta1 and theta 2 which one has smaller variance?
using r language A continuous random variable X has density function f(x)=1/56(3x^2+4x^3+5x^4).0<=x<=2 (1) secify the density g of the random variable Y you find for the acceptance rejection method. (2) what is the value of c you choose to use for the acceptance rejection method (3) use the acceptance rejection method to generate a random sample of size 1000 from the distribution of X .graph the density histogram of the sample and compare it with the density function f(x)
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY