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) );
}
}
Answer:
import java.util.Scanner;
public class ANot {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
System.out.println("How many cookies did you eat today");
int numOfCookies = in.nextInt();
double numCalories = (numOfCookies*300)/4;
System.out.println("The total number of calories you consumed in "+numOfCookies+" cookies is " +
" "+numCalories);
}
}
Explanation:
This code is implemented in Java.
- We know from the question that 4 cookies contain 300 calories
- Therefore number of calories consumed = (number of cookies eaten*300)/4
- To implement this in java we used the scanner class to prompt user for the input
- save the input to a variable and write mathematical expression for the number of calories consumed
- Then output the result
Answer:
Laser printer
Explanation:
This is a guess based on experience, but laser printers have rollers, drums, and other various parts that need periodic replacement.
See page 87 of https://www.laserpros.com/img/manuals/hp-manuals/hp-lj-4100-manual.pdf for an example.
Answer:
<em>Science is a systematic enterprise that builds and organizes knowledge in the form of testable explanations and predictions about the universe. The earliest roots of science can be traced to Ancient Egypt and Mesopotamia in around 3000 to 1200 BCE.</em>
Explanation:
<em>"</em><em>serverPc </em><em>izz </em><em>serverPc</em>
<em>Desktop</em><em> </em><em>Pc</em><em> izz</em><em> </em><em>Desktop</em><em> </em><em>Pc"</em>
What are the options and if it's meaning like when you save something it has .pdf .jpg or .doc after the title then it would be ".doc"