main () { int x, y, z,M; x=0; y=1;z=1; M=++x || ++y && ++z; cout<<"M="<
Q: (Financial application: payroll) Write a program that reads the following infor- mation and prints a…
A: CODE:- # Get the employee's namename = input("Enter employee's name: ")# Get the number of hours…
Q: Language: JAVA Leap-Year Write a program to find if a year is a leap year or not. We generally…
A: import java.io.*;import java.util.*;class LeapYear { public static void main(String args[]) throws…
Q: (PYTHON) A nutritionist who works for a fitness club helps members by evaluating their diets. As…
A: - We yave to help the nutritionist with the code.
Q: . Actions taken by the computer when a function is called, such as allocating memory for parameters…
A: Given: . Actions taken by the computer when a function is called, such as allocating memoryfor…
Q: C++ Visual 2019 A particular talent competition has five judges, each of whom awards a score…
A: Note: As score can double data type ,so, return type of findLowest() and findHighest() function…
Q: Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a…
A: Given: Package Newton’s method for approximating square roots (Case Study: Approximating Square…
Q: You need to store hiring date and date of birth for teachers, and for students store their admission…
A: Composition: Composition in C++- In real life, complex structures are often constructed from…
Q: Directions: Create a calculator that has functions than arithmetic operations e.g. scientific…
A: import java.util.Scanner; import java.lang.Math;class Calc { public static void…
Q: Assignment Description This program will simulate part of the game of Yahtzee! This is a dice…
A: Python code: yahtzee.py:
Q: JAVA LANGUAGE Body Mass Index Version 2.0 by CodeChum Admin Recall that according to the National…
A: Algorithm: Start Read height and weight Calculate bmi=703*(weight / (height * height)) Print bmi If…
Q: Problem Description: The international standard letter/number mapping found on the telephone keypad…
A: The pseudocode is as follows:Prompt user for a letter in upper caseReceive the input.Convert the…
Q: Q1/ False or true 1- Compiler translates a program written in a high-level language to machine…
A: 1) True Compiler is special software that translates (compiles) source code written in a…
Q: In Java scripts A number is called a Disarium when the sum of its digits in their respective order…
A: Algorithm - create a new method with one argument n. Now create a variable to store the number and…
Q: (Return number of digits) Write a function that returns the number of digits in an integer using the…
A: program approach returns number of digits if number is 0 return 1 else to hold count of number…
Q: in c language typedef _people { int age; char name[ 32 ] ; } People_T ;…
A: I have given an answer in step 2.
Q: Function #1: superman Parameters: height - an integer representing the user's height in inches…
A: Solution:Superman() function:#Define the functiondef superman(input_inches): #Declare the…
Q: Programming Language (Code With C Programming Language) Problem Title : Visible Trees There is a…
A: #include <stdio.h>int main(){ //number of trees int N; scanf("%d",&N); //array to…
Q: Lab 5B-Value Returning Functions Falling Distance When an object is falling because of gravity, the…
A: Here I have created a file named distance.py. Inside this, I have created a function named…
Q: Develop a C# application that inputs one salesperson’s items sold for the last week, then calculates…
A: Hello Student. Warm welcome from my side. Hope you are doing great . I will try my best to answer…
Q: Design an application that accepts 10 numbers and displays them in descending order.
A: Given: Design an application that accepts 10 numbers and displays them in descending order.…
Q: Java code please Using conditional and looping structures, make a simple calculator that does the…
A: The method split() is a string into multiple strings given the delimiter that separates them.
Q: Asap!! C# language A bank is offering Gold and Silver Credit Cards to its customers. Gold Card…
A: Objective: This program creates classes for storing information about two types of cards, i.e. Gold,…
Q: This is a simulated chess game. With this project, I want you to move all the pieces on one side of…
A: It is defined as a general purpose programming language and widely used now a days for competitive…
Q: Please code in python Forbidden concepts: recursion, custom classes A grocery store needs to…
A: apple_type = int(input("Enter the number of different type of apples: "))stock = {}for i in…
Q: C Programming Language (Code With C Programming Language) Problem Title : Visible Trees There is a…
A: Take the example of Lestari. Lestari will be able to see the following tree in first row 1. 22 1 10…
Q: Sales Commissions. You were hired in a store to implement a program that computes sales commission…
A: The required python program has been coded using if-else statements and has been provided in the…
Q: 1- Entry Controlled loops: In this type of loops the test condition is tested before entering the…
A: Given few statements The given statements are true or false is discussed below.
Q: Anagram words Write a C code that asks users to enter two words, one after the other and checks if…
A:
Q: Write a function main() and implement each math operations defined above. Design a basic calculator…
A: Check for condition in case of subtraction and division and in other cases we can proceed normally
Q: Write C++ program to create Three Students objects of a class
A: Program: #include <iostream> using namespace std; //Parent class class Student { public:…
Q: Constants in Java are: O Words that are reserved for use by the Java language O Symbolic names made…
A: I have given an answer in step 2.
Q: In C++ Find the five errors. For each error, state the line number, explain the error and show a…
A: Answer:)
Q: c. Engineering Application: Electric Field for an Insulating Sphere of Charge Use filename:…
A: #include <iostream> #include <cmath> using namespace std; const double Q = pow(10,-9);…
Q: C++ console application that will display the quotient of 10 numbers
A: Given:- C++ console application that will display the quotient of 10 numbers
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: Input : Given the s0,u0, a, and t. Output : Value of position.
Q: Following code in C using random Name Reg no and highschool name Use switch case in C language to…
A: The program is written in C #include <stdio.h>#include<stdlib.h>int main(){ int…
Q: Programming tracing C language Please help it is tracing on c programming kindly input the visual…
A: Tracing of a program refers to the process of observing each statement in it. The variable…
Q: 1- Entry Controlled loops: In this type of loops the test condition is tested before entering the…
A: Given few statements The solution is given below
Q: 4- Loop represented by the . . constructs in most programming languages. 5- If the statement is…
A: Provided the Correct answers of above given questions as shown below.
Q: mplement a class CreditCard. A CreditCard is defined by a 16-digit number and an expiration date. A…
A: Lets see the solution.
Q: Develop a body mass index (BMI) caleultor program that reads body weight and height as inputs and…
A: The complete C program is shown below. Sample Response: //C program#include<stdio.h>//main…
Q: Recursive Multiplication Design a recursive function that accepts two arguments into the parameters…
A: Recursive multiplication using python programing
Q: rint a ticket indicating the person's seat number and whether it’s in the first class or economy…
A: The below program is a code for railway reservation(seat selection) for users. It has features of…
Q: Exercise - Functions and Optionals If an app asks for a user's age, it may be because the app…
A: the code is given below :
Q: Please help me solve this problem
A: Program Instructions:Create a function with two parameters a point with integer coordinates and a…
Q: int A -1: int B-2; ((A--1) <<"This 11 (B-- exam wa
A: Solution -In the given question, we have to find the output of the given c++ block.
Q: opic: Recursive Function A bank increases the interest rate it gives to its customers by 1% every…
A: total_amount 1st month: capital+capital*interest=capital(1+interest)=1stcapital 2st month:…
Step by step
Solved in 2 steps
- In C++ QUESTION 14 class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Write the function definition for the function perimeterTerm by CodeChum Admin (JAVA CODE) Construct a class called Term. It is going to represent a term in polynomial expression. It has an integer coefficient and an exponent. In this case, there is only 1 independent variable that is 'x'. There should be two operations for the Term: public Term times(Term t) - multiplies the term with another term and returns the result public String toString() - prints the coefficient followed by "x^" and appended by the exponent. But with the following additional rules: if the coefficient is 1, then it is not printed. if the exponent is 1, then it is not printed ( the caret is not printed as well) if the exponent is 0, then only the coefficient is printed. Input The first line contains the coefficient and the exponent of the first term. The second line contains the coefficient and the exponent of the second term. 1·1 4·3 Output Display the resulting product for each of the test case. 4x^4C Programming Language (Code With C Programming Language) Problem Title : Visible Trees There is a legend about a magical park with N × N trees. The trees are positioned in a square grid with N rows (numbered from 1 to N from north to south) and N columns (numbered from 1 to N from west to east). The height (in metres) of each tree is an integer between 1 and N × N, inclusive. Magically, the height of all trees is unique. Bunga is standing on the northmost point of the park and wants to count the number of visible trees for each Column. Similarly, Lestari is standing on the westmost point of the park and wants to count the number of visible trees for each Row. A tree X is visible if all other trees in front of the tree X are shorter than the tree X. For example, let N = 3 and the height (in metres) of the trees are as follows6 1 87 5 32 9 4 On the first column, Bunga can see two trees, as the tree on the third row is obstructed by the other trees. On the second column, Bunga can see…
- Order check Write a program OrderCheck.java that takes four int command-line arguments w, x, y, and z. Define a boolean variable whose value is true if the four values are either in strictly ascending order (w < x < y < z) or strictly descending order (w > x > y > z), and false otherwise. Then, display the boolean variable value.In C# using an array Implement the inventory manager class. This class must have methods that do the following: Add a new item to the inventory manager. Remove an item from the inventory manager. Re-stock an item in the inventory manager. Display the items in the inventory manager. Search for an item in the inventory manager by at least two criteria (name, price, quantity, etc.). Test the inventory manager class with a driver program or unit tests. This may be a console application.C++ ProgrammingActivity: Deque Linked List Explain the flow of the main code not necessarily every line, as long as you explain what the important parts of the code do. The code is already correct, just explain the flow. SEE ATTACHED PHOTO FOR THE PROBLEM INSTRUCTIONS int main(int argc, char** argv) { DLLDeque* deque = new DLLDeque(); int test; cin >> test; //Declarations int tempnum; int num; int sum; int count; bool addfirst = false; bool addlast = false; bool remfirst = false; bool remlast = false; switch (test) { case 0: //Implementation do{ cin >> num; if(num == 0){ break; } //Reset tempnum = num; count = 0; sum = 0; addfirst = false; addlast = false; remfirst = false; remlast =…
- JAVA LANGUAGE Body Mass Index Version 2.0 by CodeChum Admin Recall that according to the National Heart, Lung, and Blood Institute of the National Institutes of Health, body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women. It is used to monitor one's health by determining whether one is underweight, overweight, has normal weight or is obese. It is computed based as follows (when using standard weight in pounds and height in inches): BMI = 703 x (weight/(height2)) Furthermore, people with BMI scores that are less than 18.5 are said to be underweight. Those with scores between 18.5–24.9 (inclusive) are of normal weight. Those with scores between 25–29.9 (inclusive) are said to be overweight. And those with scores 30 or higher are obese. Input The input is composed of two positive integers representing the weight in pounds and the height in inches. 140·65 Output A single line containing two values: the computed…=======================================================================PSET_3 - DESCRIPTION for JAVA PROGRAMMING SET 3=======================================================================The monthly payment on a loan may be calculated by the following formula:Rate * (1 + Rate)^NPayment = ----------------------- * L [note 1]( ( (1 + Rate)^N ) - 1)Rate is the monthly interest rate--expressed as a decimal value,which is the annual interest rate divided by 12.(12% annual interest would be 1 percent monthly interest.) [note 2]N is the number of payments, and ...L is the amount of the loan.-----------------------------------------------------------------------Note 1: '^' means exponentiation; a^b means a to the power of bHint: Use the pow() function in the Math Library.Note 2: To convert from percent to decimal ...Divide the percent value by…=======================================================================PSET_3 - DESCRIPTION for JAVA PROGRAMMING SET 3=======================================================================The monthly payment on a loan may be calculated by the following formula:Rate * (1 + Rate)^NPayment = ----------------------- * L [note 1]( ( (1 + Rate)^N ) - 1)Rate is the monthly interest rate--expressed as a decimal value,which is the annual interest rate divided by 12.(12% annual interest would be 1 percent monthly interest.) [note 2]N is the number of payments, and ...L is the amount of the loan.-----------------------------------------------------------------------Note 1: '^' means exponentiation; a^b means a to the power of bHint: Use the pow() function in the Math Library.Note 2: To convert from percent to decimal ...Divide the percent value by 100.-----------------------------------------------------------------------=======================================================================…
- mport java.util.Scanner; public class ParkingCharges { // function to calculate the basic charge using the asked hours static double getBasicCharge(int hours) { if (hours >= 7 && hours <= 8) return 5.50; else if (hours >= 5 && hours <= 6) return 4.50; else if (hours >= 2 && hours <= 4) return 4.00; return 3.00; } // function to return the amount to subtract based on local living and OAP static double getDiscount(String isLocal, String isOAP) { if (isOAP.equals("Yes") && isLocal.equals("Yes")) return 2.0 + 1.0; else if (isOAP.equals("Yes")) return 2.0; else if (isLocal.equals("Yes")) return 1.0; return 0; } public static void main(String[] args) { // create a new Scanner object Scanner sc = new Scanner(System.in); // prompt the user to ask if they are disabled…Q3: (Tax Calculator) Develop a Java program that determines the total tax for each of four citizens. The tax rate is 10% for earnings up to 50,000 RM earned by each citizen and 15% for all earnings in excess of that ceiling. You are given a list with the citizens’ names and their earnings in a given year. Your program should input this information for each citizen, then determine and display the citizen’s total tax. Use class Scanner to input the data.In C programming language write Task 2: Hangman gameWrite a terminal based on the game of Hangman. In a hangman game, the player is given a wordthat they need to guess, with each letter of the word represented by an underscore/blank. Theplayer tries to guess a letter of the word by entering it into the terminal. If the letter is correct, theblank corresponding to that letter is filled in. If the letter is incorrect, a part of a stick figure isdrawn. The player has a limited number of incorrect guesses before the stick figure is fully drawnand the game is lost. The player wins the game if they guess all the letters of the word before thestick figure is fully drawn.The program should have an array of possible words to choose from. A different word should berandomly chosen from the array every time we run the program.Others: Do not use GOTO statements