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
Shalnov [3]
3 years ago
12

You are developing a system to process lists of days of the week, represented as strings. Create a function is_weekend that cons

umes a list and returns whether the list has the string "Saturday" or the string "Sunday" in it. Call and print this function once with a list of days of the week.
Computers and Technology
1 answer:
Dafna11 [192]3 years ago
5 0

Answer:

   public static boolean is_weekend(List week){

       if(week.contains("Saturday")||week.contains("Sunday"))

       {

           System.out.println("List has a weekend");

           return true;

       }

       else{

           System.out.println("List has no weekend");

           return false;

       }

   }

Explanation:

  • Using java programming language
  • Import <em>java.util.ArrayList</em> and <em>import java.util.List;</em> so you can implement a java list
  • Create a list and add the days of the week
  • Create the required method using the contains() method to check for Sunday and Saturday and return true if the list contains them
  • See the complete program with a call to the method

<em>import java.util.ArrayList;</em>

<em>import java.util.List;</em>

<em>public class Car {</em>

<em>    public static void main(String[] args) {</em>

<em>        List<String> daysOfWeek = new ArrayList<>();</em>

<em>        daysOfWeek.add("Sunday");</em>

<em>        daysOfWeek.add("Moday");</em>

<em>        daysOfWeek.add("Tuesday");</em>

<em>        daysOfWeek.add("Wednesday");</em>

<em>        daysOfWeek.add("Thursday");</em>

<em>        daysOfWeek.add("Friday");</em>

<em>        daysOfWeek.add("Saturday");</em>

<em>        is_weekend(daysOfWeek);</em>

<em>    }</em>

<em>    public static boolean is_weekend(List week){</em>

<em>        if(week.contains("Saturday")||week.contains("Sunday"))</em>

<em>        {</em>

<em>            System.out.println("List has a weekend");</em>

<em>            return true;</em>

<em>        }</em>

<em>        else{</em>

<em>            System.out.println("List has no weekend");</em>

<em>            return false;</em>

<em>        }</em>

<em>    }</em>

}

You might be interested in
Which of the following components was a significant development featured in the Macintosh LISA computer?
Free_Kalibri [48]
I believe that the Apple Lisa computer was the first production microcomputer to have a GUI.
3 0
3 years ago
Why are salaried employees often excluded from overtime pay
lyudmila [28]

The reason why salaried employees often excluded from overtime pay because  if they are able to make a given amount or carry out a specific duties that are not recognized, they are said to be not eligible for overtime pay.

<h3>Do salaried employees get paid overtime?</h3>

A salaried employee is one that gets paid due to different kinds of work. They can be paid overtime unless there is a reason that they do not meet the test for exempt status as stated in the  federal and state laws.

Note that they are not eligible if they are specifically exempted from any form of overtime by the provisions that were given in the California Labor Code or the Industrial Welfare Commission Wage Orders that is known to be regulating wages, hours as well as working time.

Hence, The reason why salaried employees often excluded from overtime pay because  if they are able to make a given amount or carry out a specific duties that are not recognized, they are said to be not eligible for overtime pay.

Learn more about overtime pay from

brainly.com/question/19022439

#SPJ1

5 0
2 years ago
__________ is a special place on the hard drive where items from memory can be temporarily stored for fast retrieval
andrew-mc [135]
The answer is swap file 
6 0
3 years ago
Read 2 more answers
Hi um... i just wanna say hi :P
trasher [3.6K]
Lol Heyy , how are you
4 0
3 years ago
Read 2 more answers
Jack's manager asks him to distribute information and an attachment as quickly as possible to all their clients. In one to two s
snow_tiger [21]

Jack must use electronic communication or e-mail to distribute information and an attachment as quickly as possible to all their clients.  In 1–2 sentences, describe what Jack should do. In this way, he can also retain a hard copy of the memo as well as the attachments used for future reference. 



8 0
3 years ago
Other questions:
  • One of the disadvantages of Audacity is that it has limited technical support since it is a free program.     true or false
    11·2 answers
  • THE bestValue PROBLEM Using the Camera structure defined in file p1.cpp, write the function named bestValue(). The function take
    13·1 answer
  • How do you italicise, bold, letters on this app?​
    11·2 answers
  • Agent Phil Coulson developed this program to register Avengers in S.H.I.E.L.D's database using cutting-edge programming language
    15·1 answer
  • What is the acronym DOS in full
    15·1 answer
  • How can one create an online professional network using Face book?
    14·1 answer
  • When Mark completed his research paper, he decided that he wanted to have all headings to be in bold, underlined, and 14 points.
    11·1 answer
  • I used the Pearson correlation coefficient for my study to test the correlation and how strong is the relationship between two v
    10·2 answers
  • A.1111+1011. b. 10111+11111 c. 1111*1011 d. 1110*1101 perform the binary calculations.​
    12·1 answer
  • The diagram shows the positions of the Sun, Earth, and Moon during each moon phase. When viewed from Earth, at what point does t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!