Java
Given the String variable address, write an expression that returns the position of the first occurrence of the String “Avenue” in address.
LANGUAGE: JAVA CHALLENGE: Given the String variable address, write an expression that returns the position of the first occurrence of the String “Avenue” in address.
Read MoreDeclare a constant MONTHS_IN_DECADE, whose value is the value of the constant MONTHS_IN_YEAR (already declared ) multiplied by 10.
LANGUAGE: JAVA CHALLENGE: Declare a constant MONTHS_IN_DECADE, whose value is the value of the constant MONTHS_IN_YEAR (already declared ) multiplied by 10.
Read MoreDeclare an integer constant, MONTHS_IN_YEAR, whose value is 12.
LANGUAGE: JAVA CHALLENGE: Declare an integer constant, MONTHS_IN_YEAR, whose value is 12.
Read MoreOf the following variable names, which is the best one for keeping track of whether a patient has a fever or not?
LANGUAGE: JAVA CHALLENGE: Of the following variable names, which is the best one for keeping track of whether a patient has a fever or not?
Read MoreWhich is the best identifier for a variable to represent the amount of money your boss pays you each month?
LANGUAGE: JAVA CHALLENGE: Which is the best identifier for a variable to represent the amount of money your boss pays you each month?
Read MoreAssume that word is a String variable. Write a statement to display the message “Today’s Word-Of-The-Day is: “followed by the value of word on a line by itself on standard output.
LANGUAGE: JAVA CHALLENGE: Assume that word is a String variable. Write a statement to display the message “Today’s Word-Of-The-Day is: “followed by the value of word on a line by itself on standard output.
Read MoreWrite a single statement that outputs num and cost to standard output. Print both values (num first, then cost), separated by a space on a single line that is terminated with a newline character.
LANGUAGE: JAVA CHALLENGE: Two variables, num and cost have been declared and given values : num is an integer and cost is a double. Write a single statement that outputs num and cost to standard output. Print both values (num first, then cost), separated by a space on a single line that is terminated with a newline character. Do not…
Read MoreGiven an integer variable count, write a statement that displays the value of count on the screen.
LANGUAGE: JAVA CHALLENGE: Given an integer variable count, write a statement that displays the value of count on the screen. Do not display anything else on the screen — just the value of count.
Read MoreGiven a floating point variable fraction, write a statement that displays the value of fraction on the screen.
LANGUAGE: JAVA CHALLENGE: Given a floating point variable fraction, write a statement that displays the value of fraction on the screen. Do not display anything else on the screen– just the value of fraction.
Read MoreAssume that message is a String variable. Write a statement to display its value on standard output.
LANGUAGE: JAVA CHALLENGE: Assume that message is a String variable. Write a statement to display its value on standard output.
Read MoreAssume that the variables gpa, deansList and studentName, have been declared and initialized . Write a statement that adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.
LANGUAGE: JAVA CHALLENGE: Assume that the variables gpa, deansList and studentName, have been declared and initialized . Write a statement that adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.
Read MoreWrite an if/else statement that compares the value of the variables soldYesterday and soldToday, and based upon that comparison assigns salesTrend the value -1 or 1.
LANGUAGE: JAVA CHALLENGE: Write an if/else statement that compares the value of the variables soldYesterday and soldToday, and based upon that comparison assigns salesTrend the value -1 or 1. -1 represents the case where soldYesterday is greater than soldToday; 1 represents the case where soldYesterday is not greater than soldToday.
Read More