Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Please help me to make these 3 codes, that work separately together (They are numbered 1 - 4)
Fist one count 4 set of numbers vertically, second one is for number of pins which should display 0-15, the third one is a search list and the fourth is a money calculator
Please help me with my java code
Please put the four programs below into one program.
please also comment the code
class Main
{
public static void main(String[] args)
{
//example1();
example2(6);
writeVertical(120);
System.out.println(numPins(5));
}
//Infintie Recursion
public static void example1()
{
}
//Recursion with base case
public static void example2(int n)
{
if(n ==1)
{
return;
}
else
{
System.out.println(n);
example2(n-1);
}
}
//Makes the number vertical
public static void writeVertical(int num)
{
if(num ==0)
{
return;
}
else
{
writeVertical(num/10);
System.out.println(num%10);
}
}
//2
public static int numPins (int rows)
{
if(rows == 0)
{
return rows;
}
return numPins(rows - 1)+ rows;
}
}
//3
public class Search
{
static boolean searchList(int a[], int size,int num)
{
int start=0; // to indicate the starting point of list
// if size
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Similar questions
- Remaining Time: 1 hour, 28 minutes, 35 seconds. * Question Completion Status: QUESTTON 11 There are five syntax errors in the following java program. Explain them by mentioning the line number with each error. public class public static void main (String [] args) { { double a = 9; 4 double b = 9.0; int x; System.out.println ("Sum of a and b is if( a = b) + (a+b)) 80 X = a; switch (a+b) { case 0: System.out.println (x); default: System.out.println (x) ; 10 11 12 13 14arrow_forwardDirections: Code in Python and Code in Java/C++arrow_forwardJava - Data Visualization (this is not graded)arrow_forward
- C - Right Facing Anglearrow_forwardPROBLEM STATEMENT: Return the longest String! CN YOU HELP ME WITH THIS JAVA CODE PROBLEMarrow_forwardJAVA Problem: Mike loves different strings but he has no interest in programming. So, his mentor thought to give him a problem of programming including problem including strings. The problem goes like this that a box has string S and it also contains another string Y. Now he has to string Y in S and the condition is that he can arrange the characters of S in such a way that Y is there in the string. Develop a JAVA code to find out the smallest substring of S that contains Y, print the resultant string as the output. Sample Input: 1 knarameanany kar Output: aaaekarmnnnyarrow_forward
- Java - Smallest Numberarrow_forwardPython: numpy def serial_numbers(num_players):"""QUESTION 2- You are going to assign each player a serial number in the game.- In order to make the players feel that the game is very popular with a large player base,you don't want the serial numbers to be consecutive. - Instead, the serial numbers of the players must be equally spaced, starting from 1 and going all the way up to 100 (inclusive).- Given the number of players in the system, return a 1D numpy array of the serial numbers for the players.- THIS MUST BE DONE IN ONE LINEArgs:num_players (int)Returns:np.array>> serial_numbers(10)array([1. 12. 23. 34. 45. 56. 67. 78. 89. 100.])>> serial_numbers(12)array([1. 10. 19. 28. 37. 46. 55. 64. 73. 82. 91. 100.])""" # print(serial_numbers(10)) # print(serial_numbers(12))arrow_forwardjava language for solution 2. Write math random statement to generate each of the 1. random number between 0 and 1. 2. random number between 2 and 20. 3. random number between 0 and 50. 4. random number between 30 and 100. (1/2 Points) 3. having char c; C = 'a'; The result of isDigit(c) is: * (0.5/0.5 Points) truearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY