Answer to Question #35714 in Java | JSP | JSF for Amy

Question #35714
Write a program that outputs n numbers from two sequences turn by turn and each number in its own line (2*n numbers in total). The first sequence is a, a+2, a+4, ... and the second b, b+5, b+10, ... Variables n, a and b have already been declared and should be used in your program code. For example if a = 4 and b = 7, the program should output:
4
7
6
12
8
17
...
Do not write main method. Just the necessary code lines


import java.util.Random;

public class Test{
public static void main(String[] args){
Random r = new Random();
r.setSeed(Long.parseLong(args[0]));
int n = r.nextInt(100) + 100;
int a = r.nextInt(20) + 10;
int b = r.nextInt(20) + 10;
1
Expert's answer
2013-10-07T14:23:24-0400
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-35714.pdf

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS