Write a program which replaces all vowels with their corresponding numbers (e.g. a is 1, e is 2, i is 3 o is 4 and u is 5.
Q: Write a program to read the radian of a circle, check if it is bigger than zero, and if it is to…
A: #include <stdio.h> #define PI 3.14f int main(){float rad,area, perm;printf("Enter radius of…
Q: Write a program that prompts for and reads the radius and the height of a cylinder (in centimeters).…
A: Answer : Here is the C++ code: //included header file #include<iostream> //included namespace…
Q: Write a program that prints all numbers between 1 and 100 that are divisible by both 5 and 7.
A: for num in range(1,100): if num%5==0 and num%7==0: print(num)
Q: Write a python program to check if a variable, x, is divisible by 2, 3 or 5. If it is divisible by…
A: The question is to write python code for the given problem.
Q: Write a Python program which takes a number and prints the digits from the unit place, then the…
A: Write a python program that takes a number and prints the digits in reverse order.
Q: Write a program that finds the sum, difference, and product of 2 given numbers.
A: Given: To write code in C++.
Q: Write a program that reads the price and the production date(month and year of an item) then prints…
A: import java.util.*;import java.io.*; public class Main{ public static void main(String[] args)throws…
Q: Write a program that converts numbers to words. For example, 895 results in "eight nine five."
A: Below is the required C++ code. Program Approach: Include necessary header files and use a…
Q: Write a program to read a number (n). Then print all numbers from 0 to n that are not equal to 1 or…
A: Here the program is developed as per the requirement. Note: In the question programming language is…
Q: Write a program that reads an arbitrary number of integers that are in the range 0 to 50 inclusive…
A: To count occurrence of numbers between 0 and 50, create an array of size 50 and for each entered…
Q: Write a program to read a number representing the time in 24-hours (i.e., 4-digits ). Then find the…
A: Modulo(%) operator: The modulo operator (%) also called a remainder operator which is used to get…
Q: Write a Python program that takes a number from the user and prints its digits from left to right.…
A: Python used to answer this question
Q: Write a python program to find out all the odd numbers that are divisible by 5 in the range from 47…
A: Given in the question: We have to develop a python code to find out all the odd numbers that are…
Q: Write a program that reads ten integers, and then display the number of even numbers and odd…
A: The given program is in the C++ programming language.
Q: Write program to check whether a number is Palindrome or not. [Hint]: A palindrome number is a…
A: As there is no programing language mentioned so i attempted this question in c language. Palindrome…
Q: Write a program that simulates flipping a coin twomillions times and displays the number of heads…
A: Program code: //import the required packagesimport java.util.*;//Declare class HeadTailCoinpublic…
Q: Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: write a program that reads the height in centimeters and then converts the height to feet and…
A: NOTE: As the programming language is not mentioned in the question. So, we have solved this question…
Q: Write a program that sum up all prime numbers within the range of 0 and 1000.
A: Sample Response: #Python3 program to find teh sum of all prime numbers between 0 and 1000def…
Q: Write a program that reads 11 integers, compares eachinteger with the 11th integer, and displays…
A: Note: In this question, the coding language is not specified then we are doing this question in the…
Q: Write a program which reads two integer numbers from users and then display all prime numbers within…
A: According to the Question below the Complete Program: Program Output:
Q: Write a program that will draw a reversed triangle. Your program will ask for the height of the…
A: Task :- Write a C++ program to print the pattern. C++ program :- #include<iostream>using…
Q: Write a program that calculates the amount of money a person would earn over a period of time if his…
A: here in given question ask for python program.
Q: Write a program that reads a person's first and last names, separated by a space. Then the program…
A:
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse.
A: Answer: In c: #include<stdio.h>#include<string.h>int main(void){ char str[100];…
Q: Write a short C++ or Python program to support your answer (for example, show that you checked…
A: - We need to check for that the smallest number for the equation given is f that we check. - We are…
Q: Write a program that reads a person's first and last names, separated by a space. Then the program…
A: Here the scanner object is scnr. Thus using this, we can read the firstName and lastName.
Q: /Write a program that reads from the user a set of numbers, and first, it has to check how many…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it…
Q: Write a program that checks to see if the user won the lottery. Assume the winning lottery numbers…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Store the given…
Q: Write a program that reads the value of x and y, then if x is bigger than or equal y calculate and…
A: Math functions used in the program Math.pow() Math.cos The program first inputs the value of x and…
Q: Write a program that splits a 4-digits integer number into thousands, hundreds, tens, and ones. For…
A: Note: Answering the question in python as no language is specified. Input : Input the number.…
Q: Write a program to read and print 6 temperatures for 6 days and find the average for these degrees…
A: Since programming language was not mentioned , so I used PYTHON-- I have provided PYTHON CODE…
Q: Write a Python program that takes a number and tells if it is a perfect number or not. [The input…
A: Write a program that takes a number and tells if it is perfect number or not.
Q: Write a python program that reads a positive integer less than or equal to 10, and prints the…
A: while True: number = int(input("\nPlease enter a positive Integer <=10 : ")) factorial = 1…
Q: Write a program which accepts the radius of a circle from the user and compute the area and…
A: Required: To write a program that accepts the radius of a circle from the user and computes the area…
Q: Write a program to read A[n, n] of numbers, then put 10 instead each even positive number.
A: Program is written in java and commented correctly with output. Algorithm: 1. Read array of n rows…
Q: Write a program that reads an integer and displays its first five multiples. For example, if the…
A: #asking for the inputa=int(input("Enter a number : "))#loop for the 5 multiplicantsfor b in…
Q: Write a program that reads the length and width of a rectangle as integers from the keyboard and…
A: Given: We are given a program that reads input as length and width of a rectangle as integers.…
Q: Write a program that inputs a line of text from the user and counts; the total numbers of…
A: take user input of a line of text vowelCount ← 0 : variable for calculation and show output vowel…
Q: Write a program that works out whether if a given year is a leap year. A normal year has 365 days,…
A: As no programming language is mentioned, it is solved using basic C++
Q: Write a program that prints out first 40 numbers divisible by 3.
A: As you have not mentioned the programing language we are providing the program in Python language.
Q: Write a program whose input is two integers, and whose output is the first integer and subsequent…
A: import java.util.*;public class Main { public static void main(String[] args) { Scanner scan…
Q: Write a program to read a number (n). Then print all numbers from 0 to n that are not equal to 2 or…
A: Step-1: Start Step-2: Declare variable n and take input from user Step-3: Start a for loop i=0 to n…
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Please find the answer below :
Q: Write a program in the Python language to find the sum of all natural numbers in the range n to 150…
A: Write a program in the Python language to find the sum of all natural numbers in the range n to 150…
Q: Write a program that simulates flipping a coin one million times and displays the number of heads…
A: Code: public class CoinFlip { public static void main(String[] args) { int heads = 0; int…
Q: Write a program in python to set a same dice on the face every time when the dice is rolled and…
A: Required:- Write a program in python to set the same dice on the face every time when the dice is…
Q: Write a program to print even numbers from 1 to 10, print every number in a separate line.
A: Write a program in JAVA language to print even numbers from 1 to 10 in separate lines.
Q: Write a program that displays all the numbers from 300 to 400, 5 per line, that are divisible by 3…
A: Since the programming language is not mentioned, so we'll do it in java. The programming methodology…
Can someone help me with the following java program please
Step by step
Solved in 4 steps with 2 images
- import java.util.Scanner; public class TriangleArea { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Triangle triangle1 = new Triangle(); Triangle triangle2 = new Triangle(); // TODO: Read and set base and height for triangle1 (use setBase() and setHeight()) // TODO: Read and set base and height for triangle2 (use setBase() and setHeight()) System.out.println("Triangle with smaller area:"); // TODO: Determine smaller triangle (use getArea()) // and output smaller triangle's info (use printInfo()) }} public class Triangle { private double base; private double height; public void setBase(double userBase){ base = userBase; } public void setHeight(double userHeight) { height = userHeight; } public double getArea() { double area = 0.5 * base * height; return area; } public void printInfo() { System.out.printf("Base:…Create a Flowchart //Java Source Code :- import java.util.Scanner; public class bExpert { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("\nVALUES"); System.out.print("Value 1: "); int v1 = sc.nextInt(); System.out.print("Value 2: "); int v2 = sc.nextInt(); System.out.print("Value 3: "); int v3 = sc.nextInt(); System.out.println("\nPROCESS"); System.out.println("\n1. Summation"); System.out.println("2. Product"); System.out.println("3. Min / Max"); System.out.println("4. Odd / Even"); char st = 'y'; while(st != 'n'){ System.out.print("\nCHOICE: "); int ch = sc.nextInt(); switch(ch) { case 1: int sum = v1 + v2 + v3; System.out.println("\nSum = "+sum); break; case 2: int prod =…Explain these codes import java.text.DecimalFormat;import java.util.Scanner; public class Main{ private static DecimalFormat df2 = new DecimalFormat("#.00"); public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println(); System.out.print("\tEnter Name : "); String emp_name =input.nextLine(); System.out.print("\tPress F for Full Time or P for Part Time : "); char job_criteria =input.next().charAt(0); char select = Character.toUpperCase(job_criteria); System.out.println(); if (select == 'F') { System.out.print("\t------ Full Time Employee ----- "); System.out.println(); System.out.print("\tEnter Basic Pay : "); double basic_pay = input.nextDouble(); FullTimeEmployee emp = new FullTimeEmployee(); emp.setName(emp_name); emp.setMonthlySalary(basic_pay); System.out.println("\n");…
- in java String numValue is read from input. Output "Printed string: ", followed by numValue with a maximum of 7 characters, and then " is printed". End with a newline. Ex: If the input is rutabaga, then the output is: Printed string: rutabag is printed 1 2 3 4 5 6 7 8 9 10 11 12 13 import java.util.Scanner; public class StringFormatter { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); StringnumValue; numValue=scnr.next(); /* Your code goes here */ } }StringFun.java import java.util.Scanner; // Needed for the Scanner class 2 3 /** Add a class comment and @tags 4 5 */ 6 7 public class StringFun { /** * @param args not used 8 9 10 11 12 public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Please enter your first name: "); 13 14 15 16 17 18 System.out.print("Please enter your last name: "); 19 20 21 //Output the welcome message with name 22 23 24 //Output the length of the name 25 26 27 //Output the username 28 29 30 //Output the initials 31 32 33 //Find and output the first name with switched characters 34 //All Done! } } 35 36 37First, you will debug the Paint1 class so that no errors remain and all calculations work correctly by completing the following: o Find and fix the three errors in the given code. • Use the following sample input values to test your program. If you have found and fixed all the errors, your output should exactly match the sample. Input: 30 25 Output: Wall area: 750.0 square feet Paint needed: 2.142857142857143 gallons Tip: When you run your program in Eclipse, it will prompt you to enter input in the Console window. If you cannot find this window, go to Window, then Show View, then Console. Next, you will add loops to validate all user input and handle exceptions so that code passes all test cases by completing the following: • Review the code, looking for the two code blocks where user input is required. • Implement a do-while loop in both blocks of code to ensure that input is valid and any exceptions are handled. • Use the two following sample sets of input to test your program.…
- 1 import java.util.Scanner; 2 3 public class LabProgram { 4 public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(); 5 6 7 String name = sc.nextLine(); 8 String[] arr = name.split(" "); 9 if(arr.length == 3){ 10 System.out.println(); 11 System.out.println(arr[2] + 12 } 13 else{ 14 15 } 16 17 } System.out.println(arr[1] + } 3 + arr[0].charAt(0) + + arr[1].charAt(0) + "."); + arr[0].charAt(0) + ".");Write a program that takes a first name as the input, and outputs a welcome message to that name. Ex: If the input is: Pat the output is: Hey Pat! Welcome to zyBooks! 485098.3500408.qx3zqy7 LAB ACTIVITY N&600 Nm 1 import java.util.Scanner; 3 public class LabProgram { 4 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String userName; userName scnr.next(); /* Type your code here. */ 2 PPP 5 7 8 9 10 11 12} 13 7.19.1: LAB: Welcome message } LabProgram.javaimport java.util.Scanner; public class DebugSix3 { public static final int TIME_WASTER = 500; public static void main(String[] args) throws InterruptedException { Scanner input = new Scanner(System.in); System.out.print("Enter a number between 1 and 20 >> "); int num = input.nextInt(); if (num < 1 || num > 20) { System.out.println("Number out of range!"); return; } for (int i = num; i > 0; i--) { System.out.print(i + " "); Thread.sleep(TIME_WASTER); } System.out.println("Blastoff!"); } } The 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. An example of the program is shown below: Enter a number between 1 and 20 >> 5 5 4 3 2 1 Blastoff! Depending on the value assigned to the…
- in java Write code that prints: firstNumber … 2 1Print a newline after each number. Ex: If the input is: 3 the output is: 3 2 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import java.util.Scanner; public class ForLoops { publicstaticvoidmain (String [] args) { intfirstNumber; inti; Scannerinput=newScanner(System.in); firstNumber=input.nextInt(); for () { System.out.println(i); } } }Write an java application from the code below that accepts three Strings from the user and displays them in alphabetical order without regard to case. import java.util.*; public class Alphabetize2 { public static void main(String[] args) { String str1, str2, str3; Scanner in = new Scanner(System.in); System.out.print("Enter first string >> "); str1 = in.nextLine(); System.out.print("Enter second string >> "); str2 = in.nextLine(); System.out.print("Enter third string >> "); str3 = in.nextLine(); // display strings in alphabetical order if(str1.toLowerCase().compareTo(str2.toLowerCase()) < 0 && str2.toLowerCase().compareTo(str3.toLowerCase()) < 0) System.out.println("You entered the strings in alphabetical order"); else System.out.println("You did not enter the words in alphabetical order"); } }import java.util.Scanner;//import java.util.Random;public class FinalExam3{public static void main (String() args) {Scanner input = Scanner(System.in);System.out.print("Enter the amount of times a pair of dice will roll: ");int times = keyboard.nextInt();int[] dicePairs = rollDicePairs(times);System.out.println("The rolled pairs of numbers are:");printDicePairs(dicePairs);System.out.println("The sum of each pairs of numbers are:");int[][] dicePairsSums = addDicePairs(dicePairs);printDicePairsSums(dicePairsSums);}public static double[][] rollDicePairs(int times){int[][] dice = new int[times][2];Random die = new Random();for(int x=0; x<times;x++){for(int y=0; y<2; y++){dice[x][y] = 1+die.nextInt(6);}}return dice;}public static void printDicePairs(int[][] dicePairs){for(int[] pair: dicePairs){for(int roll: pair){System.out.print(roll+" ");}System.out.println("");}}public static int[][] addDicePairs(){int[] pairSums = new int[dicePairs.length];for(int x=0; x<pairSums.length;…