Web Development
Write an expression that results in a String consisting of the third through tenth characters of the String s.
LANGUAGE: JAVA CHALLENGE: Write an expression that results in a String consisting of the third through tenth characters of the String s.
Read MoreAssume that name is a variable of type String that has been assigned a value. Write an expression whose value is a String containing the last character of the value of name. So if the value of name were “Smith” the expression’s value would be “h”.
LANGUAGE: JAVA CHALLENGE: Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is a String containing the last character of the value of name. So if the value of name were “Smith” the expression’s value would be “h”.
Read MoreAssume that name has been declared suitably for storing names (like “Amy”, “Fritz” and “Moustafa”)
LANGUAGE: JAVA CHALLENGE: Assume that name has been declared suitably for storing names (like “Amy”, “Fritz” and “Moustafa”). Assume also that stdin is a variable that references a Scanner object associated with standard input. Write some code that reads a value into name then prints the message “Greetings, NAMEVALUE!!!” on a line by itself where…
Read MoreSuppose a reference variable of type File called myFile has already been declared. Create an object of type File with the initial file name input.dat and assign it to the reference variable myFile.
LANGUAGE: JAVA CHALLENGE: Suppose a reference variable of type File called myFile has already been declared. Create an object of type File with the initial file name input.dat and assign it to the reference variable myFile.
Read MoreGiven an integer variable i and a floating-point variable f, that have already been given values, write a statement that writes both of their values to standard output in the following format
LANGUAGE: JAVA CHALLENGE: The exercise instructions here are LONG — please read them all carefully. If you see an internal scrollbar to the right of these instructions, be sure to scroll down to read everything. Given an integer variable i and a floating-point variable f, that have already been given values, write a statement that…
Read MoreWrite a program that takes the account’s present value, monthly interest rate, and the number of months that the money will be left in the account as three inputs from the user.
LANGUAGE: PYTHON CHALLENGE: Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f = p * (1 + i)^t • f is the future value…
Read MoreWrite a Boolean function named is_prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that prompts the user to enter a number and then prints whether the number is prime.
LANGUAGE: PYTHON CHALLENGE: A prime number is a number that is only evenly divisble by itself and 1. For example, the number 5 is prime because it can only be evenlly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 2 and 3. Write a…
Read MoreWrite an expression (not a statement!) whose value is the largest of population1, population2, population3, and population4 by calling max2.
LANGUAGE: PYTHON CHALLENGE: assume that max2 is a function that expects two int parameters and returns the value of the larger one. Also assume that four variables , population1, population2, population3, and population4 have already been defined and associated with int values. Write an expression (not a statement!) whose value is the largest of population1,…
Read MoreWrite an expression (not a statement!) whose value is the larger of population1 and population2 by calling max.
LANGUAGE: PYTHON CHALLENGE: max is a function that expects two int parameters and returns the value of the larger one. Two variables , population1 and population2, have already been defined and associated with int values. Write an expression (not a statement!) whose value is the larger of population1 and population2 by calling max.
Read MoreDefine a function called min that takes two parameters containing integer values and returns the smaller integer of the two. If they have equal value, return either one.
LANGUAGE: PYTHON CHALLENGE: Define a function called min that takes two parameters containing integer values and returns the smaller integer of the two. If they have equal value, return either one.
Read MoreDefine a function called isSenior that takes a parameter containing an integer value and returns True if the parameter is greater than or equal to 65, and False otherwise
LANGUAGE: PYTHON CHALLENGE: Define a function called isSenior that takes a parameter containing an integer value and returns True if the parameter is greater than or equal to 65, and False otherwise
Read MoreDefine a function called signOf that takes a parameter containing an integer value and returns a 1 if the parameter is positive, 0 if the parameter is 0, and -1 if the parameter is negative
LANGUAGE: PYTHON CHALLENGE: Define a function called signOf that takes a parameter containing an integer value and returns a 1 if the parameter is positive, 0 if the parameter is 0, and -1 if the parameter is negative
Read More