Best Solutions to Programming Problems in any Programming Language
Simple and well-optimized solutions to any coding problems in any programming language. Also, explore answers to technical coding questions.
- write a program on 3D Shape that consists of length, width and height. Then implement two classes (Square and Rectangle) that 'inherit' length, width and height from Shape. Then write a main program that asks the user to enter the thr…
- Suppose we implement a program to simulate a computer whose ability is to carry out binary arithmetic, using bitwise operators.
Your should perform the following bitwise operations using the logical operators:
~ (not operato… - Write a program that includes an Employee class that can be used to calculate and print the take-home pay for a commissioned sales employee. All employees receive 7% of the total sales. Federal tax rate is 18%. Retirement contribution…
- Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping options, each with specific costs associated. Create an inheritance hierarchy to represent various types of packages. Use Package as the ba…
- Draw an inheritance hierarchy for students at a university. Use Student as the base class of the hierarchy, then include classes UndergraduateStudent and GraduateStudent that derive from Student. Continue to extend the hierarchy as de…
- Discuss the ways in which inheritance promotes software reuse, saves time during program development and helps prevent errors.
- A company pays its employees on a weekly basis. The employees are of four types: Salaried employees are paid a fixed weekly salary regardless of the number of hours worked, hourly employees are paid by the hour and receive “time-and-a…
- Create a class Saving Account. Use a static variable annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance indicating the amount the …
- Write a program that will accept up to 10 integers. The program compares the numbers to determine which is maximum and which one is minimum. At the end the program outputs the minimum number entered and maximum number entered.
- Implement the Shape hierarchy shown in Figure below. Each TwoDimensionalShape should contain method getArea to calculate the area of the two-dimensional shape. Each ThreeDimensionalShape should have methods getArea and getVolume to ca…
- a) Define the class bankAccount to store a bank customer’s account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide the following operations: set the a…
- Banks offer various types of accounts, such as savings, checking, certificate of deposits, and money market, to attract customers as well as meet with their specific needs. Two of the most commonly used accounts are savings and checki…
- Suppose there are n people standing in a circle. Person no.1 has a sword and he uses it kill no.2 and passes it onto person no.3. All the persons does the same until only 1 survives. Which number will survive at last and what algorith…
- This one is a fairly simple program, but I like it a lot. It is called the 'hailstone sequence' problem. There is a sequence of numbers in mathematics that is sometimes known as the hailstone sequence. The German mathematician, Lothar…
- Write a program that takes a number n and outputs a point−down triangle of height n and width 2n−1; the output for n = 6 would be: Enter a number: 6 *********** ********* ******* ***** *** *
- Write a program that prints out the lyrics to that beloved classic, that field-trip favorite: '99 Bottles of coke on the Wall.' Lyric: 99 bottles of coke on the wall, 99 bottles of coke. Take one down and pass it around, 98 bottles of…
- Write a program that asks for a starting year and an ending year and then puts all the leap years between them (and including them, if they are also leap years). Leap years are years divisible by 4 (like 1984 and 2004). However, years…
- The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets: box, sideline, premium, and general admission. After each game, data is stored in …
- Write a program to read from a file containing the details of a restaurant order. The details in the file include the item number, quantity and price. Store the details of at least five items in the file. Calculate the subtotal by add…
- Three employees in a company are up for a special pay increase. You are given a file, say Data.txt, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an emplo…