Write a program to input side of a square and find the area and perimeter of a square.
Bob employs a painting company that wants to use your services to help create an invoice generating system. The painters submit an invoice weekly. They charge $30 per hour worked. They also charge tax – 15%. Bob likes to see an invoice that displays all the information – number of hours, the charge per hour, the total BEFORE tax and the total AFTER tax. Since this is an invoice, we also need to display the name of the company (Painting Xperts) at the top of the invoice. Display all of the information on the screen.
Find out the number of occurrence of vowels, characters and digits in the given statements
Input:
#$@aghte123
AqEtImU@123
xyz@12345
Output:
2 5 3
4 7 3
0 3 5
Class Name : Worker
Name : To store the name of the worker
Basic : To store the basic pay in decimals
Worker (…) : Parametrized constructor to assign values to the instance variables
void display() : Display the workers details
Class Name : Wages
hrs : Stores the hours worked
rate : Stores rate per hour
wage : Stores the overall wage of the worker
Wages (…) : Parametrized constructor to assign values to the instance variables of both the classes
double overtime() : Calculates and returns the overtime amount as (hours*rate)
void display() : Calculates the wage using the formula wage = overtime amount + Basic pay and displays it along with the other details
Specify the class Worker giving details of the constructor () and void display ( ). Using the concept of inheritance, specify the class Wages giving details of constructor ( ), double overtime( ) and void display(). The main ( ) function must be written to perform the task.
Design a c program the embed special characters as leading and trailing to the input string and display the output
Input:
Strnset
#
4
Output:
####set
Str####
Write a program that has a method commonPre (String str1, String str2) that
returns the common prefix of two strings. For example, the common prefix of “distance” and
“disinfection” is “dis”. If the two strings have no common prefix, the method displays “No
common prefix”. The user should be prompted to enter two strings in JOptionPane and
display their common prefix, if any. Use JOptionPane for all inputs and outputs.
Write a program that defines five integer variables and initializes them to I. 10, 100, 1000, and 10000 and prints them on a single line separated by spaces.
It takes 4 hours to drive a distance of 150 km in car.create a program to calculate the average speed in km/h
To print 3 digit number and peint the digit of the number in reverse order
write a programm to print hard if any carry in addition of two given numbers otherwise print easy.