
create a Word document that contains the pseudocode, flowchart, and test plan for (Programming Projects 2(
import java.util.Scanner;
public class Exercise07_03 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int[] counts = new int[101]; // Array to store the occurrences
// Read integers from user until 0 is entered
System.out.print("Enter the integers between 1 and 100: ");
int number = input.nextInt();
while (number != 0) {
if (number >= 1 && number <= 100) {
counts[number]++; // Increment the count for the number
}
number = input.nextInt();
}
// Display the counts for each number
for (int i = 1; i < counts.length; i++) {
if (counts[i] > 0) {
System.out.println(i + " occurs " + counts[i] + (counts[i] > 1 ? " times" : " time"));
}
}
}
})
and 5(
import java.util.Scanner;
public class Exercise07_19 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter list: ");
int size = input.nextInt();
int[] list = new int[size];
for (int i = 0; i < size; i++) {
list[i] = input.nextInt();
}
if (isSorted(list)) {
System.out.println("The list is already sorted");
} else {
System.out.println("The list is not sorted");
}
}
public static boolean isSorted(int[] list) {
for (int i = 0; i < list.length - 1; i++) {
if (list[i] > list[i + 1]) {
return false; // Not sorted in increasing order
}
}
return true; // Sorted in increasing order
}
})
from Chapter 7) that you completed in Revel.

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images

- Write the exact output that you expect to see on the screen when the indicated statements are executed as part of a complete program. int[] x = {10, 15, 20); arrayProcess (x); System.out.println (x [0] + " " + x[2]); public static void arrayProcess (int[] a) { for (int k = 0; k< 3; k++) { a[k] = a[k] + 3; } }arrow_forwardJava - Write a program that removes all non alpha characters from the given input.arrow_forwardThe files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. // Application looks up home price // for different floor plans // allows upper or lowercase data entry import java.util.*; public class DebugEight3 { publicstaticvoidmain(String[] args) { Scanner input =newScanner(System.in); String entry; char[] floorPlans = {'A','B','C','a','b','c'} int[] pricesInThousands = {145,190,235}; char plan; int x, fp =99; String prompt ="Please select a floor plan\n"+ "Our floorPlanss are:\n"+"A - Augusta, a ranch\n"+ "B - Brittany, a split level\n"+ "C - Colonial, a two-story\n"+ "Enter floorPlans letter"; System.out.println(prompt); entry = input.next(); plan = entry.charAt(1); for(x =0; x < floorPlans.length; ++x) if(plan == floorPlans[x]) x = fp; if(fp =99) System.out.println("Invalid floor plan code entered")); else { if(fp…arrow_forward
- Fill in the blank with the correct answer/output. int[] nums = {78, 94, 850, 425, 375, 67}; int[] numsTen = {1,2,3,4,5,6,7,8,9,10}; double[] dblNums = {3.4, 2.75, 3.8, 4.0, 1.5} System.out.print( dblNums [0]); // LINE 1 1. wor www w System.out.print (nums [3]-25); // LINE 2 2. System.out.print{ nums [5]); // LINE 3 3. System.out.print( dblNums [3]); // LINE 4 4. System.out.print (numTens.length) ; // LINE 5 5. System.out.print (numsTen.length/2); // LINE 6 6. System.out.print (numsTen [6]); // LINE 7 7. System.out.print nums [0]); // LINE 8 8. System.out.print nums [9]); // LINE 9 9. System.out.print nums [6/2] ); // LINE 1o 10. System.out.print{ numsTen [2] ); // LINE 11 11. System.out.print{ dblNums [db1Nums.length-1]); // LINE 12 12. System.out.print nums [5/4]); // LINE 13 13. System.out.print{ nums [3]); // LINE 14 14.arrow_forwardthis needs to be corrected The file provided in the code editor to the right contains syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors. java import java.util.Scanner; public class DebugThree3 { public static void main(String args[]) { String name; name = getName() displayGreeting(namme); } public static String getName(void) { String name; Scanner input = new Scanner(System.in); System.in.print("Enter name "); name = input.nexlLine(); return namer; } public static displayGreeting(String name) { System.outprintln("Hello, " + name + "!"); } }arrow_forward3. Write a Java program to test if an array contains a specific value. PS: Please upload the output and say the logic behind it. Thank you!arrow_forward
- The image below is the assignment, and above that is the code written to solve it...Please explain each step to me with "//" !! using System; namespace SalesCommision { internal class Program { private static void Main(string[] args) { double[] arrayValue = new double[9]; Console.Write("Please enter the salesperson's salary or 0 to exit: "); double inputValue = Convert.ToDouble(Console.ReadLine()); while (inputValue != 0) { inputValue = (inputValue * (0.09)) + 200; if (inputValue < 300) { arrayValue[0] = arrayValue[0] + 1; } else if (inputValue < 400) { arrayValue[1] = arrayValue[1] + 1; } else if (inputValue < 500) { arrayValue[2] = arrayValue[2] + 1; }…arrow_forwardExplain what the code does step by step.arrow_forwardJAVA Language: Transpose Rotate. Question: Modify Transpose.encode() so that it uses a rotation instead of a reversal. That is, a word like “hello” should be encoded as “ohell” with a rotation of one character. (Hint: use a loop to append the letters into a new string) import java.util.*; public class TestTranspose { public static void main(String[] args) { String plain = "this is the secret message"; // Here's the message Transpose transpose = new Transpose(); String secret = transpose.encrypt(plain); System.out.println("\n ********* Transpose Cipher Encryption *********"); System.out.println("PlainText: " + plain); // Display the results System.out.println("Encrypted: " + secret); System.out.println("Decrypted: " + transpose.decrypt(secret));// Decrypt } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new…arrow_forward
- Can you fix my for loop not sure what's wrong Can you add class level comments, function level comment and in-line comments import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter n : "); int n = sc.nextInt(); int sum=0; for(int i=1;i<=n;i++) sum+=i; System.out.printf("Sum is %d",sum); }arrow_forwardIdentify the errors in the following code segment * provide the correction for each error. Import Java.util.scanner; public class Readable { public Static void main(String[] args) { Scanner KB ; int shares; double averagePrice = 14.67; Shares = KB.nextDouble(); System.out.println("There were " , shares + " shares sold at $" + averagePrice + " per share."); } }arrow_forward- Write a java program that contains a two-dimensional array of 2 rows and 3 columns. Find the sum of each row in the array, trace the code using a tracing table. - Note: No two students can try the same inputs. - You should submit the code and the tracing table in a handwritten pdf file. - Also, you should submit the code and a screenshot of the output using a word file. Tracing Table may look like the following table: Line# i j Array[0][0] Array[0][1] Array[0][2] Array[1][0] Array[1][1] Array[1][2] rowSum Output …….arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





