64 484
Assignments Done
99,1%
Successfully Done
In September 2018

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;
Expert's answer

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions