Answer:
I am doing it with python.
Explanation:
nums = '9 -8 -7 -6 -5 -4 -2 0 1 5 9 6 7 4'
myfile = open('data.txt', 'w')
myfile.write(nums)
myfile.close()
myfile = open('data.txt', 'r')
num1 = (myfile.read())
num1 = num1.split()
print(num1)
print(type(num1))
for x in num1:
x = int(x)
if x < 0:
minus = open('dataminus.txt', 'a')
minus.write(str(x) + ' ')
minus.close()
elif x>= 0:
plus = open('dataplus.txt', 'a')
plus.write(str(x)+' ')
plus.close()
Answer:
boolean recalled;
((modelYear>=1995 && modelYear <=1998) || (modelYear>=2004 && modelYear<=2006)) ? recalled =true : recalled =false;
Explanation:
In the first line of the code we declare the variable of type boolean (values can only be true or false) then using the conditional expression operator (ternary operator) in place of an if statement, We state the conditions of the years that will return true and vice versa
Email? Dropbox?...Not sure give one of these a try? Hope this helps
I'm going to assume this is Java, because you said "method" meaning it will be some sort of object oriented language, and Java's really common. Here would be the full program, but you can just take the method out isolated if you need it.
package lastname;
public class LastName {
public static void main(String[] args) {
// Example usage:
String name = LastName.lastName("Garrett Acord");
System.out.println(name);
// Output: Acord G.
}
public static String lastName(String fullName)
{
String[] splitName = fullName.split(" ");
return String.format("%s %s.", splitName[1], splitName[0].substring(0,1) );
}
}