Find the error(s), if any 1) void main() { int a = 15; float b = 10; char cha = 'a'; char chb = 'b'; do{ a += b; a = a * b / 4; cout<
Q: Write a code in c++ Maintain a bookshelf that initially contain 2 books. Now you purchased three…
A: In this program we will use stack data structure as the statement says the last book that will be…
Q: Note: Please answer in C++ Programming language. During Eid, it is a tradition for every father to…
A: Input-Output Format: The first line of the input contains a single integer T denoting the number of…
Q: PART 1: REPETITION CONTROL STRUCTURE (FOR) Instruction: Create a flowchart and a java program that…
A: Flowchart:
Q: PART 1: REPETITION CONTROL STRUCTURE (FOR) Instruction: Create a flowchart and a java program that…
A: Required : A java program that checks if an input number is perfect, deficient or abundant as per…
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: Consider yourself driving with 60 miles/hour in a city that has only grid like streets, and your GPS…
A: Java Code: // Include the necessary header files. import java.io.*; import java.util.Random; import…
Q: In the sport of diving, seven judges award a score between 0 and 10, where each score may be a…
A: Diving scores use a range from one to 10, in ½-point increments. The score of each dive is…
Q: Make this C language code into modular code (functions) #include #include main() { char choice; int…
A: CODE:
Q: C++ Programming: You are roaming in a random city and you have lost. You see a sign board and where…
A: The answer is
Q: User Defined Function: Void Function Create a JAVA program that will add,…
A: Here in the main method, I have displayed the menu and then taken input from the user. Next, I have…
Q: Write a method called DisplayPersonalInfo(). This method will display your name, school, program and…
A: Introduction: Method: It is a collection of statements defined in an order to perform a particular…
Q: C++ program where a user can input his weight and height and the program suggests him a suitable…
A: C++ used to answer this question
Q: The syntax does not belong c++ O class void Vehicle O class Child: public Parent O using namespace…
A: Note:- As per our guidelines, we can answer your first question and also second question looks…
Q: A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend…
A: #include <iostream>#include "functions.h" using namespace std; int main(){ while(true)…
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: write a program which will accept one integer argument and returns count of digits of that argument…
A: First, we pass the argument to function Digitcounter using the main function. Using while loop l…
Q: Computer Science Please provide UML diagram and Java code Directions This exercise requires…
A: import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import…
Q: Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a…
A: def newton(n): sgn = 0 if n < 0: sgn = -1 n = -n val = n while True:…
Q: C++ Programming point* go_far(point* other) Return the point bearing the x- and the y- coordinates…
A: Algorithm: Start Implement a struct point with 2 struct variables x,y Inside the struct implement…
Q: C# language A bank is offering Gold and Silver Credit Cards to its customers. Gold Card allows a…
A: using System; class InvalidCreditAmount : Exception{ public InvalidCreditAmount(String…
Q: C++ programming Chapter(s) Covered: Chapter 1-8 Concepts tested by the program: Working with one…
A: Code: #include<iostream>#include <algorithm>using namespace std; // Global…
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: n programming language c Write the difference between structure and arrays. Also discuss a scenario…
A: Answer: The difference between array and structure are below:- Array Structure 1.Array…
Q: C++ Language This is to confirm my work, the wording throws me off a bit in understanding how…
A: code in C++
Q: SOLVE IN C PROGRAMMING LANGUAGE Q# 4. Illustrate your knowledge of C-Programming by implementing a…
A: Given: To write a C-Programming to implement a 'Game of Dice'. The user will start with 3 lives and…
Q: In c++ Language . MATCh INPUT AND OUTPUT ----------------- ABC Bank announced a new scheme of…
A: //C++ program #include <iostream> using namespace std; //VISACard class class VISACard{…
Q: IN PYTHON PLEASE AND FLOWCHART DRAWING COPUTERIZED PLEASE!! In many businesses across the…
A: Program:- import sysTotalAmount=input("Enter total cost of purchase: ") GivenCash=input("Enter…
Q: . I have no ideal on how to start this one on control structures: You have been given a contract…
A: Required: You have been given a contract for making little conical cups that are used for bottled…
Q: Medication dosage by weight A machine administers medication dosage based on weight. Write an…
A: According to the question given:- we have to create program for Medication dosage by weight For that…
Q: Write assignment statements for the following: Assign a value of 1 to between if n is in the range…
A: The answer is as follows:-
Q: A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend…
A: Below i have given program:
Q: Consider the following recursive function. What does it calculate in terms of x, y, and z? In visual…
A: The given function CalRecurse(x,y,z) makes a recursive call on the value of x. With each recursive…
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: C++ Language code and explain Zodiac Sign Identifier - Ask the user's birth month and birth day…
A: Answer: Coding Language : C++
Q: C++ PROGRAM Problem Statement: A 4th grader is having trouble with Permutation and…
A: - We need to highlight the code for the provided scenario of permutations and combinations in C++…
Q: C++ Programming Activity: Deque Linked List Explain the flow of the main code not necessarily every…
A: Initially addFirst, addLast, remFirst, remLast are false tempnum, num, sum, count are declared as…
Q: valuate the following expression: (3 % 5)
A: need to evaluate the following expression: (3 % 5)
Q: B is K ∴ No K is J Convert the following argument into symbolic form and then determine whether it…
A: Lets see the solution.
Q: Make this C language code into modular code (functions) #include #include main() { char choice; int…
A: #include<stdio.h>#include<math.h> void squareroot(int n1){ int result = sqrt(n1);…
Q: Problem Description Design a flowchart using Flogorithm, to solve the following problem, then open…
A:
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: 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: Question #1: Write a C program that implements the following pseudocode: 1. Input an integer…
A: if-else is a control flow statement that tests a condition or expression of if statement. The "if"…
Q: Case Study – Depreciation Calculator Design and develop a solution with functions (modules) and…
A: Introduction : Here we have to create a Depreciation Calculator . where , Input : Original value…
Q: After a specific amount of time has passed, an initial block statement can no longer be utilised.
A: Intro Initial block: An initial block cannot be synthesized or turned into a hardware schematic with…
Q: O A thrown Error indicates a serious problem that a reasonable application should not try to catch.
A: Error is a subclass of Throwable that indicates serious problems that a reasonable application…
Q: : Correct the syntax errors void Main () { int x, Y; const a = 14; ww w cin >> x , y; ww if a=x*y;…
A: Things needed to be remember:- c++ is a case sensitive programming language. if you need to use…
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:…
Q: Sub: Data structure Consider the following 'C' routine int DO ( int a[ ], int /b, int ub) { int…
A: The program has two parts: Calling function: It generally pass the value(s) to the called function…
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Find the error(s), if any
1)
void main()
{
int a = 15;
float b = 10;
char cha = 'a';
char chb = 'b';
do{
a += b;
a = a * b / 4;
cout<<a<<b/a<<endl
cout<<cha;
for (int i=0; i<20; i++);
{
cout<<i;
}
}while(a=<1000)
};
2)
The following code should output the even integers from 2 to 100:
counter = 2;
do
{
cout << counter << endl;
counter += 2;
}
While ( counter < 100 );
Step by step
Solved in 4 steps with 1 images
- Parking Charges Program in java Write a program that works out the amount a person has to pay for parking in a car park in a tourist town. If they say they are disabled, they are told it is free. Otherwise they enter the number of hours as a whole number (1-8) that they wish to park as well as whether they have an “I live locally” badge or are an old age pensioner both of which leads to a discount. The program tells them the cost to park. The calculation is done in this program as follows. If they are disabled it is free. Otherwise ... Take number of hours they wish to park and give a basic charge: • • • • 1 hour: 3.00 pounds 2-4 hours: 4.00 pounds 5-6 hours: 4.50 pounds 7-8 hours: 5.50 pounds Next modify the resulting charge based on whether they are local or not: • If local: subtract 1 pound If OAP: subtract 2 poundsYour program MUST include methods including ones that - asks for the hours and returns the basic charge. - asks whether they live locally /…C++ PROGRAMMING PART C Please help me i am stressing so much on this. I would really appreciate it. THIS was the code provided to me to help me solve the question. const int N =31; // N parking spaces bool parking[N]; // the garage void EmptyTheLot(bool parking[], int N) { for(int i=0; i<N; i++) p[i]=false; // empty space } // returns -1 if no space found, //otherwise it returns 0<=i<N for a valid space. int FindSpace(int PlateNumber, bool parking[], int N) { // ????? } main() { EmptyTheLot(parking, N); // start with an empty parking garage. // get plate numbers and fill lot. }User Defined Function: Void Function Create a JAVA program that will add, subtract, multiply and divide two numbers. Use user defined function for each operator Any number divided by zero will result to undefined Use int or double data type only for all variables declaredEXPECTED OUTPUT:
- JAVA Programming Problem 2 - Diving In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating-point value. The highest and lowest scores are thrown out and the remaining scores are added together. The sum is then multiplied by the degree of difficulty for that dive. The degree of difficulty ranges from 1.2 to 3.8 points. The total is then multiplied by 0.6 to determine the diver’s score. Write a computer program that will ultimately determine the diver’s score. This program must include the following methods: A method name inputValidScore that inputs one valid score for one judge for one diver. This method will return the valid score. A method named inputAllScores that creates an array to store the scores for all judges for the diver. This method will fill the array with a valid score from each judge. This method does not take input arguments, but it does return the array of scores. A method named inputValidDegreeOfDifficulty that inputs a…Flow chart for a program called TimeConvertor.java that converts times expressed in 24-hour clock to 12-hour clock and that converts times expressed in 12-hour clock to the 24-hour clock.(Financial application: payroll) Write a Java program that reads the following information and prints a payroll statement:
- 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.Part 2 - OddOrEven ClassIn bluej. Write a program that prompts the user to enter an integer. The program should display “The input is odd" to the screen if the input is odd and displays “The input is even" to the screen if the input is even. Hint: Consider using the mod (%) operator.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…
- Part 2 - OddOrEven ClassWrite a program that prompts the user to enter an integer. The program should display “The input is odd" to the screen if the input is odd and displays “The input is even" to the screen if the input is even. Hint: Consider using the mod (%) operatorComputer Fundamentals and Programming 2 Write a program that determines a student’s grade. The program will accept 3 scores and computes the average score. Determine the grade based on the following rules: - If the average score is equal or greater than 90, the grade is A. - If the average score is greater than or equal to 70 and less than 90, the grade is B. - If the average score is greater than or equal to 50 and less than 70, the grade is C. - If the average score is less than 50, the grade is F. Source Codes and Print Screen of the Output(Simple computation) The formula for computing the discriminant of a quadratic equation ax^2 + bx + c = 0 is b^2 – 4ac. Write a program that computes the discriminant for the equation 3x^2 + 4x + 5 = 0. Class Name: Exercise01_01Extra