<< Prev Showing: 76-80 of 101 Next >>
· 51-55 · 56-60 · 61-65 · 66-70 · 71-75 · 76-80 · 81-85 · 86-90 · 91-95 · 96-100 · 101-101 ·Flow control using n! and e^x for iteration
((The following is exactly how the problem is presented)) import java.util.Scanner; import java.text.DecimalFormat; /** Iteratively computes e^x for a given value x, outputing values at iteration 1 to 10, 50, and 100 */ public class Ex { public static void main(String[] args) { // Make a Scanner to read data from the console Scanner console = new Scanner(System.in); // Make a NumberFormat object that we'll use when printing values // of n in the loop below DecimalFormat nFormat = new DecimalFormat("000"); // Read in a number for x System.out.println("Enter a value for x (or a blank line to quit):"); ... click for more
Subject:
Computer Science
Topic:
Software Design and Architecture
Posting ID:
174178
OTA ID:
101298
JAVA 101:beersong.java...convert integer to string for iteration
-------------------------------------------------------------------------- Instructions are as follows....... Write a program that outputs the lyrics for "Ninety Nine Bottles of Beer on the Wall". Your program should print the number of bottles in English, not as a number. For example: Ninety nine bottles of beer on the wall, Ninety nine bottles of beer, Take one down, pass it around, Ninety eight bottles of beer on the wall. … One bottle of beer on the wall, One bottle of beer, Take one down, pass it around, Zero bottles of beer on the wall. Your program should not use ninety nine different output statements! Design your program with a class named BeerSong whose constructor... click for more
Subject:
Computer Science
Topic:
Software Design and Architecture
Posting ID:
174439
OTA ID:
101298
/** Class that maintains a Celsius or Fahrenheit temperature value */ class Temperature { /** Temperature value */ private double value; /** Scale, either "C" for Celsius or "F" for Fahrenheit */ private char scale; // -------------------------------- // ----- ENTER YOUR CODE HERE ----- // -------------------------------- // -------------------------------- // --------- END USER CODE -------- // -------------------------------- /** Returns a string containing the value and scale of the Temperature */ public String toString() { return Double.toString(value) + scale; } } /** Demo... click for more
Subject:
Computer Science
Topic:
Software Design and Architecture
Posting ID:
174493
OTA ID:
101298
Implement a recursive algorithm to find the maximum element of given integer array A.
Implement two recursive algorithms to solve the following problems: Problem 1: Implement a recursive algorithm to find the maximum element of given integer array A. Count the number of comparisons while finding the maximum element and print input size, maximum element, and number of comparisons. Example: integer array A=[1,2,4,1,65,234,12,-10,-100] Output of your program : Input size is : 9 Maximum element: 234 Number of compassion: 10 (This is just an example) Problem 2: Implement a recursive algorithm to reverse given array of characters and print bot... click for more
Subject:
Computer Science
Topic:
Software Design and Architecture
Posting ID:
175072
OTA ID:
103987
I cannot get it to display the restocking fee or even know how to type the code for it. I am lost. • Modify the Inventory Program by creating a subclass of the product class that uses one additional unique feature of the product you chose (for the DVDs subclass, you could use movie title, for example). In the subclass, create a method to calculate the value of the inventory of a product with the same name as the method previously created for the product class. The subclass method should also add a 5% restocking fee to the value of the inventory of that product. • Modify the output to display this additional feature you have chosen and the restocking fee.
Subject:
Computer Science
Topic:
Software Design and Architecture
Posting ID:
175739
OTA ID:
101298
<< Prev Showing: 76-80 of 101 Next >>
· 1-5 · 6-10 · 11-15 · 16-20 · 21-25 · 26-30 · 31-35 · 36-40 · 41-45 · 46-50 · 51-55 · 56-60 · 61-65 · 66-70 · 71-75 · 76-80 · 81-85 · 86-90 · 91-95 · 96-100 · 101-101 ·Page generated in 0.1079 seconds