Consider the following code segment, which uses properly dec…
Consider the following code segment, which uses properly declared and initialized int variables x and y and the String variable result. String result = “”; if (x < 5){ if (y > 0) { result += “a”; } else { result += “b”; }}else if (x > 10){ if (y < 0) { result += "c"; } else if (y < 10) { result += "d"; } result += "e";}result += "f"; What is the value of result after the code segment is executed if x has the value 15 and y has the value 5?
Read DetailsConsider the following description of method printValues. …
Consider the following description of method printValues. Method printValues Method Signature Explanation public void printValues(int numTimes, int val) Prints the value of val a total of numTimes times, thenmoves the cursor to a new line. Consider the following code segment, which appears in the same class as printValues. printValues(2, 3);printValues(4, 5); What is printed as a result of executing the code segment?
Read DetailsTwo computers are built by different manufacturers. One is r…
Two computers are built by different manufacturers. One is running a Web server and the other is running a Web browser. Which of the following best describes the ability of the two computers to communicate with each other across the Internet?
Read DetailsDineOutHelper is a mobile application that people can use to…
DineOutHelper is a mobile application that people can use to select a restaurant for a group meal. Each user creates a profile with a unique username and a list of food allergies or dietary restrictions. Each user can then build a contact list of other users of the app. A user who is organizing a meal with a group selects all the members of the group from the user’s contact list. The application then recommends one or more nearby restaurants based on whether the restaurant can accommodate all of the group members’ allergies and dietary restrictions. Suppose that Alejandra is using DineOutHelper to organize a meal with Brandon and Cynthia. Which of the following data is not provided by Alejandra but is necessary for DineOutHelper to recommend a restaurant for the group? I. Brandon’s contact list II. Information about which restaurants Brandon and Cynthia have visited in the past III. Information about which food allergies and dietary restrictions can be accommodated at different restaurants near Alejandra
Read DetailsA teacher sends students an anonymous survey in order to lea…
A teacher sends students an anonymous survey in order to learn more about the students’ work habits. The survey contains the following questions. ● On average, how long does homework take you each night (in minutes)? ● On average, how long do you study for each test (in minutes)? ● Do you enjoy the subject material of this class (yes or no)? Which of the following questions about the students who responded to the survey can the teacher answer by analyzing the survey results? I. Do students who enjoy the subject material tend to spend more time on homework each night than the other students do? II. Do students who spend more time on homework each night tend to spend less time studying for tests than the other students do? III. Do students who spend more time studying for tests tend to earn higher grades in the class than the other students do?
Read Details