Question
Write a java program which asks the user to enter name and age and calls the following methods:
a. printName(): Takes name as parameter and prints it 20 times using a while loop.
b. printAge(): Takes age as parameter and prints all the numbers from 1 up to age.
 
Please strictly follow the format.shoen below Note: any extra or missing space / line will lead to test failure.
(The output should look like exactly as the example shown below and with the commas included in the last line and all numbers in same line too. Use import so we can put our own names and numbers.)
 
Name: Andy
Age: 10
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
Andy
1,2,3,4,5,6,7,8,9,10
 
 
 
 
class Main {
public static void main(String[] args) {

}
}

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Java

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: One of the major goals and challenges of GM was to consolidate its information systems. As noted in ...

A: ERP helps the General Motors achieve goal: Enterprise resource planning (ERP) is a type of software ...

Q: You are creating a new, innovative machine for a company that you work for. The idea is new and will...

A: Intellectual property rights are generally used to recognize a person's creation or innovation, i.e....

Q: A hacker overloads the KOI website and shutdowns the service so that legitimate users such as studen...

A: The type of attack carried out is DDoS attack.

Q: Write an 8051 C program for timer-0 to generate a signal with 10 ms ontime and 5 ms off time.

A: Click to see the answer

Q: Hi, I need to answer this question using the C++ programming language. Thank you. Note: I have inclu...

A: In the solution of given problem, we need to read two integer numbers say integer1 and integer2, the...

Q: Write a program that takes as input an arithmetic expression followed by a semicolon ;. The program ...

A: Actually, the code has given below:

Q: a) create a dictionary, rank = {1:"Freshman", 2:"Sophmore", 3:"Junior", 4:"Senior" }b) request a use...

A: rank = {1: "Freshman", 2: "Sophmore", 3: "Junior", 4: "Senior"} n = int(input("Enter number of years...

Q: I need use case diagram examples for systems using add-on exstention like grammarly or any system..

A: A use case diagram is generally used to obtain overall requirements, functionalities, actors, and th...

Q: develop project schedule for creating job portal using gantt chart

A: The Gantt Chart is a great way to build your project schedule and visually judge its progress. Read ...

Q: Given the following three word sequences (i.e., the corpus)– very good tennis player in US open– ten...

A: Terminology : Sentence : unit of written language.Word Form : The inflected form that appears in the...

Q: *Python Programming*-Use Atom. Print "warm" if s is not equal to w, otherwise print "cold". Use the ...

A: A required program is as follows, #Initialize the variables s = 'summer' w = 'winter' #Check if s is...

Q: Using Java script solve the following problem. //problem to solve: how many students passed and //ho...

A: <script> var myArray = [1,2,1,1,2,1,1,2,2,2]; for (index = 0; index < myArray.length; index...

Q: Write a value-returning method that returns the product of all the elements in an integer array

A: class Person: listnew=[1,2,3,4]  def __init__(self):    continue   def myfunc(self):    print(listne...

Q: . Draw the graph of the NRZ-L, NRZ-I, Manchester scheme, differential Manchester scheme using eachof...

A: Actually, the answer has given below:

Q: In python explain why would we want to read a file line by line instead of all at once?

A: In python readline() method returns one line from the file in the form of a string. We can also use ...

Q: 3. Write a python program to read a number and print a right triangle using E.g. : Input : 5 -Output...

A: Python program for Pyramid Printing: Patterns can be imprinted in python utilizing basic for circles...

Q: Run the following Java code and explain what it does.  Give the resulting image from the code   publ...

A: This code has three different files: 1. main 2.MyFrame 3. MyPanel main.java is initiating the code a...

Q: 15: points.cpp) Write a program that reads 10 pairs of Cartesian coordinates from a file called "poi...

A: Objective: This program would sort 10 pairs of coordinates whose values would be achieved from a giv...

Q: a) 10.21.2.128/8b) 10.128.0.0/25c) 200.200.100.0/24d) 200.200.100.127/25e) 200.200.100.128/25 From t...

A: 200.200.100.128/25 explanation: it is usually the last address. for example. 192.128.64.1 = first ho...

Q: i)Complement of L

A: Finding the complement of a language, L: For getting the complement of any L over a DFA, the non-fin...

Q: technology in the workplace

A: Actually, the answer has given below:

Q: please help

A: n = 8while True:    print(n)    n = n + 6    if n > 38:        break print() n = 8flag = Truewhil...

Q: Problem_#06] Express the following numbers in 8 bit l's complement notation. (а) —34 (b) +57 (с) —99...

A: NOTE: -Hi, Since multiple questions are there, only the first problem is solved below. 6(a) -34 STEP...

Q: (I'm very confused with this, kinda not understanding, any chance you can help answer and explain. T...

A: Introduction of Program This previous C++ program uses if-else to implement calculator code means + ...

Q: Draw an ER diagram to show the relationships among the tables

A: The ER diagram is as follows:

Q: Given the following tree, implement DFS(Þepth-first Search), IDDFS(iterative Deepening Breath First ...

A: EXPLANATION: BFS: Check the starting node and add its neighbours to the queue. Mark the starting no...

Q: Time CalculatorWrite a program that asks the user to enter a number of seconds.-There are 60 seconds...

A: The below given Java program will obey the following rubrics: Importing required package. Defining ...

Q: Hi, I need to answer this question using the C++ programming language. Thank you. Note: I have inclu...

A: Program description: The objective of the main.cpp file is to print users to enter length and width ...

Q: Create a class Queue that implements the functionality of a queue providing all the requiredoperatio...

A: Programming approach Here, a class Queue is created with the following members: Integer  "front", "...

Q: Write the algorithm in pseudocode for scan-converting (filling in the interior) of an axis-aligned r...

A: //To Draw a Right angled Triangle Input Coordinates for A, B C // AB - Base (x axis) BC is Perpendic...

Q: Write a C++ program using WHILE LOOP that prompts for an integer N. The program reads N numbers, fin...

A: Below is the required C++ code. Program Plan: Include a necessary header files and use a namespace...

Q: GM being a global virtual company definitely presents with several areas of information ethics. Rich...

A: Areas of information ethics Richard O Mason identified four different areas of information ethics. ...

Q: As the network administrator for a growing ISP, you want to make efficient use of your network addre...

A: Actually, the answer has given below:

Q: What are agile methods? Are they better than traditional methods? Why or why not?

A: Click to see the answer

Q: Write a C/C++ program that prompts the user to enter N integer values and stores it in an array. Dis...

A: #include <iostream>using namespace std;int main(){    int num, n, index = 0;    cout << ...

Q: How is the proliferation of mobile devices that are locally powerful, use apps instead of full- fled...

A: Mobile devices, because of their use anywhere and anytime, use applications requiring Internet Conne...

Q: To be eligible for the leadership training program offered by the office, a student must have at lea...

A: =IF((A1>=2)*OR(B1="Yes"),"YES","NO")

Q: An architectural firm of eight employees, each with a networked desktop computer, wants you to devel...

A: The answer has given below:

Q: what is the process model and the use case diagram of the given UML diagram? (a samll size software ...

A: The process model for the above UML diagram is called as pet shop process model. Process Model is de...

Q: Write a program that uses nested loops to collect data and calculate the average rainfall over a per...

A: #include<iostream> using namespace std; int main(){    int numberOfYears=0, totalRainfall=0;  ...

Q: This C++ assignment uses the same account class created in Lab #4 with a more generally useful inter...

A: #include <iostream> using namespace std; // class class Bank { private: int acno; cha...

Q: THIS IS ALL FOR YHE SAME PROBLEM! For each of the operations below: ˆ - convert all values to the...

A: In science and computerized hardware, a binary number is a number communicated in the base-2 numeral...

Q: Python elif if

A: westernMarried,easternMarried,southernMarried=0,0,0;westernSingle,easternSingle,southernSingle=0,0,0...