public int compute(int m) { int c = -1; int b = 1; while (b < m) { C++; b++; ++C; } return c; }
Q: Sanchez Construction Loan Co. makes loans of up to $100,000 for construction projects. There are two...
A: public abstract class Loan implements LoanConstants{ private long loanNumber; private String c...
Q: Write a program which should consists of a user defined function “maximum ()”. Pass 1D array to the ...
A: You haven't mentioned the programming language. So, we are answering this question using C. Program ...
Q: Problem 2: How many times will "Hello" be printed? Express that number using summation, then give a ...
A: The ask is to find out the number of times the word "Hello" would be printed and then express that n...
Q: When you are prompted to enter a value when you run a query which includes a calculated field, you p...
A: Overview : You can easily create a calculated field in Access queries. A calculated field is a field...
Q: Hi, I need to answer this question. The name of the book is "Computer Security and Penetration Testi...
A: The evolution of programming exploits are : Computer programming is the very basis of the digital ag...
Q: C# Programming
A: Code : using System; class Motherboard: IComparable<Motherboard>{private static int count = 0;...
Q: What this command means? $ more ~/Study/diary
A: Please find the answer below:
Q: C programming
A: #include <stdio.h> int main(void) { int i,blank=0,pos,wordlen; int fpos=0; char sentence...
Q: “Array name can act as a constant pointer”. Justify the given statement by distinguishing array name...
A: An array is the simplest data structure that can be applied for data storage in computers. It holds ...
Q: Stack is a linear data structure which follows a dynamical order in preforming operations, LIFO. In ...
A: Stack is a linear data structure which follows LIFO (Last In First) approach which means the element...
Q: In SQL create two tables by the name A and B with one common column: table A : fields: id, name, ph...
A: Introduction of SQL Command: Database language is used to manipulate databases. The database is a co...
Q: Write a program to count composite numbers from m and n (including m and n also) using the concept o...
A: Please find the answer below :
Q: This code should be working at repl.it
A: GIVEN: Create a Java program that gets the last three digits of the student ID from the user. Then f...
Q: What is the issue parallelism (IP) of a superscalar machine of width (or degree) N? What is the issu...
A: Superscalar machines were originally developed as an alternative to vector machines. A superscalar m...
Q: WRITE AN ALGORITHM OF THIS FLOWCHART IN STEPS.
A: Introduction of the Algorithm and Flow Chart: An algorithm is a step-by-step procedure to solve a ta...
Q: **JAVA LANGUAGE** Beginner Level Suppose that a Scanner object contains a bunch of tokens all on a...
A: Steps followed for partialSum method: Declaring and initializing the total variable and X variable...
Q: Hello! I need the PSEUDOCODE(not source code) for this problem please! Just the pseudocode! Thank yo...
A: Actually, pseudocode is a plain language description
Q: Can you all please help me with this data structure question the language is Java
A: import java.util.*;public class Test121 { public static void main(String args[]) { Scanner sc = new...
Q: Mick’s Wicks makes candles in various sizes. Create a class for the business named Candle that conta...
A: public class Main{ public static void main( String[] args ){ //create Candle instance...
Q: Create a Pseudocode for the following python problem:
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: This is a matlab coding problem Implement a recursive function, called isPalindrome, that takes a a...
A: function isPalindrome = palindrome(x) x = upper(char(varargin{1})); n = length(x); iseven = rem(n...
Q: JAVA Prime numbers are numbers that have only 2 factors: 1 and themselves. For example, the first 5 ...
A: import java.util.*;class Test122 { public static void main(String args[]) { Scanner sc = new Scanne...
Q: How Wireless Communication can be good for an organization? Elaborate your answer with a real-life s...
A: Actually, wireless communication is transfer the information between two or more points without usin...
Q: Write pseudo code of the algorithm to solve the following problem with minimum number of floor check...
A: Gadget test can be done from floor 1 to last floor in the sequence, using one gadget . This sequence...
Q: What is the use of a web form and the roles of controls and widgets in a web form?
A: Use of web forms: A web form in an HTML page is similar to a paper form. It is used by a person usin...
Q: Determine if the following graph contains a Hamiltonian circuit. If there is a Hamiltonian circuit...
A: The, given circuit is
Q: I_Do: Week 12 Chapter 9: Classes and Multiform Projects 2 Dorm and Meal Plan Calculator (Nr 6, Page ...
A: Swing is a framework that allows to create form applications simply. Swing is based on AWT, an olde...
Q: PYTHON Problem Statement Implement a function which takes two arguments: the first is a string and t...
A: Programming instructions: Create a function. In the function, create the required variables. Use ...
Q: Student name: CIS 232 Introduction to Programming Homework Assignment 10 Due Date: 11/23/2020 Instr...
A: The matrix multiplication is each and every element is sum of product of values in same row in first...
Q: Write a program which should consists of a user defined function “Task ()” [Function returns no valu...
A: Explanation: An array has been crated and passed as reference to the function. Position of largest e...
Q: Can you please help me build a flowchart for this code?
A:
Q: Bubble Sort You will change the following method bubbleSort() by using generics and complete only o...
A: Generic type: Generic types are used to model the parameterized types. The generic method/class para...
Q: please use C++ Programming Language to answer the following question Use inheritance and classes to ...
A: A Card object needs instance variables to represent its value and suit. I've made these private so t...
Q: write a lex program to Read the input string and Check whether the string is identifier/ keyword /sy...
A: Lex is a computer program that generates lexical analyzers and was written by Mike Lesk and Eric Sch...
Q: Write an application that allows a user to enter the names and birthdates of up to 10 friends. Conti...
A: import java.util.*;public class BirthdayReminder { public static void main(String args[]) { Scanner...
Q: Hi! I need help with this homework! (it is C prgramming ) Thank you
A: #include <stdio.h>#include <stdlib.h>#include <time.h> int main() { srand(time(0))...
Q: What is the speedup of the parallel solution? A. 6 minutes B. 4 minutes ос 2 D. 3 0000
A: SEQUENTIAL ALGORITHM : Sequential algorithms are those algorithm in which the execution of instructi...
Q: Several people working on the Global Treps Project are confused about theirresponsibilities for prov...
A: The activities included: The activities in the WBS for the in- house development include thefollowin...
Q: This is the question I am struggling with - The developers of a free online game named Sugar Smash ...
A: Explanation: Object of base class (SugarSmashPlaye) has been created and values are assigned to its ...
Q: What kinds of video formats are the best to use on a website? How would you embed a video into your ...
A: you can choose these video formats according to some criteria here i am listing some criteria from...
I need help to compile this code in Java. What value of m would give the return 3???
Step by step
Solved in 3 steps with 1 images
- please help me with the following 1) make a sierpenski triangle using java and recursion. Make it similar to the code below. And please comment the code 2) Please make the follow code out put on the console. It a t square fractal import java.awt.image.*;import java.awt.Color;import java.io.*;import javax.imageio.*; public class Main{ static final int DIMENSION = 1000; static BufferedImage image = new BufferedImage(DIMENSION, DIMENSION, BufferedImage.TYPE_INT_RGB); static final int WHITE = Color.WHITE.getRGB(); static final int BLACK = Color.BLACK.getRGB(); private static void drawSquare(int x, int y, int side) { if (side <= 0) return; else { int left = x - side/2; int top = y - side/2; int right = x + side/2; int bottom = y + side/2; for (int i = left; i < right; i++) for (int j = top; j < bottom; j++) { image.setRGB(i, j, BLACK); }…java A time series is represented a list of time/value pairs Write a function that takes two time series and outputs a new series of the summation of themJAVA Implement the equals method of the Arrow class. Two arrows are equal when they have the same starting point and direction. public class Arrow{ private Point start; private String direction; /** Constructs an arrow. @param x the x-position @param y the y-position @param direction a compass direction N E S W NE NW SE SW */ public Arrow(int x, int y, String direction) { start = new Point(); start.move(x, y); this.direction = direction; } /** Checks whether this arrow is equal to another. @param otherObject another arrow @return true if this arrow and otherObject have the same position and direction. */ public boolean equals(Object otherObject) { /* code goes here */ }}
- Help with java Please import java.util.*; public class Recursion{ public static void main(String args[]){ Scanner input = new Scanner(System.in); String exp = input.nextLine(); System.out.println(solver(exp.split(" "))); } public static double solver(String[] expression){ double result = 0; if(expression.length == 3){result = add(Double.parseDouble(expression[0]),Double.parseDouble(expression[2]));} else if(expression.length == 5){result = add(Double.parseDouble(expression[0]),Double.parseDouble(expression[2]),Double.parseDouble(expression[4]));} else if(expression.length == 7){result = add(Double.parseDouble(expression[0]),Double.parseDouble(expression[2]),Double.parseDouble(expression[4]),Double.parseDouble(expression[6]));} else if(expression.length == 9){result = add(Double.parseDouble(expression[0]),Double.parseDouble(expression[2]),Double.parseDouble(expression[4]),Double.parseDouble(expression[6]),Double.parseDouble(expression[8]));} else if(expression.length == 11){result =…import java.util.Scanner; public class LabProgram { // Recursive method to draw the triangle public static void drawTriangle(int baseLength, int currentLength) { if (currentLength <= 0) { return; // Base case: stop when currentLength is 0 or negative } // Calculate the number of spaces needed for formatting int spaces = (baseLength - currentLength) / 2; if (currentLength == baseLength) { // If it's the first line, don't output spaces before the first '*' System.out.println(" ".repeat(spaces) + "*".repeat(currentLength)); } else { // Output spaces and asterisks System.out.println(" ".repeat(spaces) + "*".repeat(currentLength)); } // Recursively call drawTriangle with the reduced currentLength drawTriangle(baseLength, currentLength - 2); } public static void drawTriangle(int baseLength) { drawTriangle(baseLength, baseLength); } public…import java.util.Scanner; public class LabProgram { // Recursive method to draw the triangle public static void drawTriangle(int baseLength, int currentLength) { if (currentLength <= 0) { return; // Base case: stop when currentLength is 0 or negative } // Calculate the number of spaces needed for formatting int spaces = (baseLength - currentLength) / 2; if (currentLength == baseLength) { // If it's the first line, don't output spaces before the first '*' System.out.println("*".repeat(currentLength) + " "); } else { // Output spaces and asterisks System.out.println(" ".repeat(spaces) + "*".repeat(currentLength) + " "); } // Recursively call drawTriangle with the reduced currentLength drawTriangle(baseLength, currentLength - 2); } public static void drawTriangle(int baseLength) { drawTriangle(baseLength, baseLength); } public static…
- Write code in Java: - Make sure code is recursive. - Do not change any other part of code. import java.util.*; import java.lang.*; import java.io.*; class DecimalToBinary { public static String decimalToBinary(int value) { //*Code goes here* } } class DriverMain { public static void main(String args[]) { Scanner input = new Scanner(System.in); System.out.print(DecimalToBinary.decimalToBinary(input.nextInt())); } }In Java, recursion can be used to solve different problems such as factorial of a given number. ___________________ implies 5 x 4 x 3 x 2 x 1.Java Programming 1. Write a recursive method to convert from decimal to Binary. 2. Write a recursive method to count the number of vowels in a given string. 3. Write a recursive method to find a character in a string. Your answer
- Write code in Java: -Must be recursive import java.util.*; import java.lang.*; import java.io.*; //*Analysis goes here* //*Design goes here* class AllPermutation { public static void displayPermutation(String s) { //*Code goes here* } public static void displayPermutation(String s1, String s2) { //*Code goes here* } } //*Driver class should not be changed* class DriverMain { public static void main(String args[]) { Scanner input = new Scanner(System.in); AllPermutation.displayPermutation(input.nextLine()); } }Write code in Java: - Make sure code is recursive. import java.util.*; import java.lang.*; import java.io.*; class DecimalToBinary { public static String decimalToBinary(int value) { //*Code goes here* } } class DriverMain { public static void main(String args[]) { Scanner input = new Scanner(System.in); System.out.print(DecimalToBinary.decimalToBinary(input.nextInt())); } }Using recursion, write a Java program that creates an array of 10 numbers entered by the user. The recursive function receives the array and the position of the starting point of the array. The function returns the index of the smallest element of the array. The main method outputs the smallest of these numbers using the returned index.