Calculate the number of pounds and ounces in a given number of ounces. (16 ozs to a lb) Assume ounces stores a total number of ounces. Print the number of Ibs and ozs. Try to do this without declaring any new variables. (Use just a printing statement) For example, if ounces is 38, print "38 ounces is 2 Ibs, 6 ozs"
Q: Create a program that will ask the user to enter a string Your task is replace the elements in the…
A: Hello Student. Warm welcome from my side. Hope you are doing great. I will try my best to answer…
Q: 1. What is wrong with the following condition? Correct it. if (grade > 70 || grade <= 80)
A: Conditions in java are used to pass through certain conditions.
Q: Clickzone Copy Center charges Php 15 for the first 10 copies, plus 0.75 per copy for the next 10…
A: The program is written in java import java.util.*;public class Main{ public static void…
Q: 2. Create a program that will display the following output using for(), while() and do-while()…
A: Import the java utility In main Class declare the variables m and n Get the m and n value from the…
Q: If class Apple extends class Fruit, which of the following is also true? O Fruit is the super class…
A: Correct Answer: - All of the above For Fruit is the super class of Apple It is correct because…
Q: You run four computer labs. Each lab contains computer stations that are numbered as shown in the…
A: JAVA PROGRAM: //Import the required package.import java.util.*; //Define the class.public class LAB…
Q: 1. Write a nested loop that displays 15 rows of '*' characters. There should be 30.'*' characters in…
A: As per the requirement program first program is developed. Note: As per our guidelines we are…
Q: Input: Operation to be made N number of inputs based on the operation Output: The calculator should…
A: First print all the menus. Read the choice of user and store in a character variable. If choice is…
Q: Software Requirements: Latest version of NetBeans IDE • Java Development Kit (JDK) 8 Procedure: 1.…
A: Program: import java.util.*;import java.io.*; public class Main{ public static void main(String[]…
Q: Draw a flowchart to sum the even numbers between 0 and 59.
A: Initialize a variable sum to zero.Iterate through numbers from 0 to 59.For each number, check if it…
Q: 1. Create a program that will display the following output using for(), while() and do-while()…
A: public class pattern { public static void main(String[] args) // main function {…
Q: Construct a class named TestCirde whose main() method dedares THREE (3) Cirde objects. Using the…
A:
Q: Write an application that catches and throws an ArithmeticException when you attempt to take the…
A:
Q: Create a program that will compute for the area and perimeter of a rectangle using classes. You must…
A: length and width will be the variables of Rectangle class getArea() and getPerimeter() will be the…
Q: 15.7 (Telephone-Number Word Generator) Standard telephone keypads contain the digits zero through…
A: Introduction Inheritance: Inheritance is a crucial OOP concept (Object-Oriented Programming). The…
Q: Question Print Daily Company (PDC) needs a program that displays weekly salary. PDC has five…
A: Code with the OOP approach in JAVA is given below along with output
Q: Create a program that will ask the user to enter the elements of a 3 x 4 matrix. Your task is to…
A: Algorithm: Start Read a 3×4 matrix 'a' Initialize sum to 0 and count to 0 Iterate through the…
Q: The lucky number is the sequence number generated by the filter algorithm: if the number in the…
A: Step 1: Generate a list from 1 to size. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,…
Q: Write an application that displays the multiplication table for numbers from 1 to 9. The table…
A: Java code: public class Main { //class public static void main(String[] args) { //main…
Q: Java programming
A: Program: //import the header file import java.util.Scanner; import java.text.DecimalFormat;…
Q: 10.14 (Project: Shape Hierarchy) Implement the Shape hierarchy shown in Fig. 9.3. Each Two-…
A: Solution: Given,
Q: Every cylinder has a base and height, where the base is a circle. Design the class Cylinder that can…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid, as…
A: import java.util.*;import java.lang.*;import java.io.*; class Codechef{ public static void main…
Q: In this chapter, the class Date was designed to implement the date in a program, but the method…
A: /* Java program to test class */ public class Date { // Instance variables int day;…
Q: Every circle has a center and a radius. Given the radius, we can determine the circle's area and…
A: public class Point{ double x, y;public Point(){setPoint( 0, 0 );}public Point(double x, double y…
Q: Write a method with the following header that returns a pentagonal number: public static int…
A: The nth pentagonal number pn is given by the formula: pn = (3n2 - n) / 2 for n >= 1.
Q: Implement a program that can input an expression in postfix notation (see Exer- cise C-6.19) and…
A: The program is written in Java. Check the program screenshot for the correct indentation. Please…
Q: FOR ALL PARTS, MAKE SURE YOUR METHODS ARE STATIC O PART 1: Method with Output O Define a method…
A: class MethodPractice{ public static void printHelloworld() {…
Q: Given the following: public class Beta extends Alpha{ Java syntax requires class Beta to have a…
A: False
Q: Write a method LinkedList joinLists (LinkedList list1, LinkedList list2) to join two linked lists…
A: Solution: Java code: import java.util.*; public class Test { /** * This method take two…
Q: Create a folder named LastName_FirstName in your local drive. (ex. Reyes_Mark) Using NetBeans,…
A: The program is written in Java. Please find the source code and output in the below steps.
Q: In this exercise, you will design various classes and write a program to computerize the billing…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: 14.13 (Tokenizing and Comparing Strings) Write an application that reads a line of text, tokeniz- es…
A: Code Sample Output
Java
Step by step
Solved in 2 steps with 2 images
- Matric Number: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your matric number. If the first digit of y is 0, replace it with 2. Ехатple: If you matric number is 2013034, Thus, x = 201 and y = 234 a. Write the values of x and y based on your matric number. b. If a = x (mod 7) and b = (-1) + y (mod 7), find the integer(s) c with 10Summary Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and d2 is the number of days payment is made before billing cycle. Then, the average daily balance is: averageDailyBalance = (netBalance * d1 payme If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is: interest averageDailyBalance * 0.0152 Instructions Write a program that accepts as input netBalance, d1, payment, d2, and interest rate per month ( interestRate).use visual basic Depreciation to a Salvage Value of 0 . For tax purposes an item may be depreciated over a period of several years, n . With the straight-line method of depreciation , each year the item dpreciates by 1/nth of it original value. with the double-declining-balance method of depreciation, each year the item depreciate by 2/nths of its value at the beginning of that year.(In the final year it is depreciated by its value at the beginning of the year. ) Write a program that performs the following tasks:(a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. The method of depreciation should be chosen by clicking on one of two buttons.(b) Display a year- by-year description of the depreciation. See Fig. 6.15 .How to attempt? Question : The Card Game One day, Fred and his N friends were playing a card game in which each player throws a card with a number written on it. The cards are such that a number X is written on front of the card, and the negative of that number is written on the back side of the card. This game has the following rules: - Each of the N players is asked to throw a card. After all the N cards are thrown, Fred has to flip one or more cards in consecutive order, only once. Your task is to help Fred flip the cards in such a way that the sum of the numbers, on front face of the cards, is the maximum.The Problem: You need to increment a variable in the fastest possible way.The following statement should determine if x is not greater than 20. What is wrong with it?Months Given the current month X, find out what month it will be after Y months have passed. You may not use the following keywords: if, while, for. $ python month.py 13 It's currently January, in 3 months it will be April. $ python month.py 5 20 It's currently May, in 20 months it will be January. $ python month.py 12 12 It's currently December, in 12 months it will be December.Language: JAVA Leap-Year Write a program to find if a year is a leap year or not. We generally assume that if a year number is divisible by 4 it is a leap year. But it is not the only case. A year is a leap year if − It is evenly divisible by 100 If it is divisible by 100, then it should also be divisible by 400 Except this, all other years evenly divisible by 4 are leap years. So the leap year algorithm is, given the year number Y, Check if Y is divisible by 4 but not 100, DISPLAY "leap year" Check if Y is divisible by 400, DISPLAY "leap year" Otherwise, DISPLAY "not leap year" For this program you have to take the input, that is the year number from an input file input.txt that is provided to you. The input file contains multiple input year numbers. Use a while loop to input the year numbers from the input file one at a time and check if that year is a leap year or not. Create a class named LeapYear which will contain the main method and write all your code in the main…7) The ideal gas law allows the calculation of volume of a gas given the pressure(P), amount ofthe gas (n), and the temperature (T). The equation is:V = nRT / PSince we only have used integer arithmetic, all numbers will be integer values with nodecimal points. The constant R is 8.314 and will be specified as (8314/1000). This givesthe same result. Implement the idea gas law program where the user is prompted for andenters values for n, T, and P, and V is calculated and printed out. Be careful toimplement an accurate version of this program. Your program should include a properand useful prompt for input, and print the results in a meaningful mannerSEE MORE QUESTIONS