Tag: Java

Assume that x is a char variable has been declared and already given a value. Write an expression whose value is true if and only if x is NOT a upper-case letter.

Assume that x is a char variable has been declared and already given a value. Write an expression whose value is true if and only if x is NOT a upper-case letter.

LANGUAGE: Java CHALLENGE: Assume that x is a char variable has been declared and already given a value. Write an expression whose value is true if and only if x is NOT a upper-case letter....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Suppose a reference variable of type String called myString has already been declared.

Suppose a reference variable of type String called myString has already been declared.

LANGUAGE: Java CHALLENGE: Suppose a reference variable of type String called myString has already been declared. Create an object of type String and assign it to the reference variable myString....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Write a statement that reads a word from standard input into firstWord.

Write a statement that reads a word from standard input into firstWord.

LANGUAGE: Java CHALLENGE: Write a statement that reads a word from standard input into firstWord. Assume that firstWord. has already been declared as a String variable. Assume also that stdin is a variable that references a Scanner object associated with standard input....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Write a single statement that will print the message “first is ” followed by the value of first, and then a space, followed by “second = “, followed by the value of second.

Write a single statement that will print the message “first is ” followed by the value of first, and then a space, followed by “second = “, followed by the value of second.

LANGUAGE: Java CHALLENGE: Write a single statement that will print the message “first is ” followed by the value of first, and then a space, followed by “second = “, followed by the value of second. Print everything on one line and go to a new line after printing. Assume that first has already been declared...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is the last character of the value of name.

Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is the last character of the value of name.

LANGUAGE: Java CHALLENGE: Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is the last character of the value of name. So if the value of name were “Blair” the expression ‘s value would be ‘r’....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Write a method, isEmailAddress, that is passed a String argument.

Write a method, isEmailAddress, that is passed a String argument.

LANGUAGE: Java CHALLENGE: Write a method, isEmailAddress, that is passed a String argument. It returns true or false depending on whether the argument has the form of an email address. In this exercise, assume that an email address has one and only one “@” sign and no spaces, tabs or newline characters....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Consider this data sequence: “fish bird reptile reptile bird bird bird mammal fish”.

Consider this data sequence: “fish bird reptile reptile bird bird bird mammal fish”.

LANGUAGE: Java CHALLENGE: Consider this data sequence: “fish bird reptile reptile bird bird bird mammal fish”. Let’s define a SINGLETON to be a data element that is not repeated immediately before or after itself in the sequence. So, here there are four SINGLETONs (the first appearance of “fish”, the first appearance of “bird”, “mammal”, and the...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Write a loop that reads strings from standard input where the string is either “land”, “air”, or “water”.

Write a loop that reads strings from standard input where the string is either “land”, “air”, or “water”.

LANGUAGE: Java CHALLENGE: Write a loop that reads strings from standard input where the string is either “land”, “air”, or “water”. The loop terminates when “xxxxx” (five x characters ) is read in. Other strings are ignored. After the loop, your code should print out 3 lines: the first consisting of the string “land:” followed by...

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Write an expression that evaluates to true if the value of the string variable s1 is greater than the value of string variable s2.

Write an expression that evaluates to true if the value of the string variable s1 is greater than the value of string variable s2.

LANGUAGE: Java CHALLENGE: Write an expression that evaluates to true if the value of the string variable s1 is greater than the value of string variable s2....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Write an expression that evaluates to true if and only if the string variable s equals the string “end”

Write an expression that evaluates to true if and only if the string variable s equals the string “end”

LANGUAGE: Java CHALLENGE: Write an expression that evaluates to true if and only if the string variable s equals the string “end”....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Write an expression that evaluates to true if the value of the string variable s1 is greater than the value of string variable s2.

Write an expression that evaluates to true if the value of the string variable s1 is greater than the value of string variable s2.

LANGUAGE: Java CHALLENGE: Write an expression that evaluates to true if the value of the string variable s1 is greater than the value of string variable s2....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More

Assume that s is a String. Write an expression whose value is true if and only if the value of s would come between “mortgage” and “mortuary” in the dictionary.

Assume that s is a String.  Write an expression whose value is true if and only if the value of s would come between “mortgage” and “mortuary” in the dictionary.

LANGUAGE: Java CHALLENGE: Assume that s is a String. Write an expression whose value is true if and only if the value of s would come between “mortgage” and “mortuary” in the dictionary....

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days - Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level

Read More