Part of the following pseudocode is incompatible with the Java, Python, C, and C++ languages. Identify the problem. How would you fix the problem if you were to translate this pseudocode into one of the aforementioned languages?
Module checkEquality(Integer num1, Integer num2)
If num1 = num2 Then
Display "The values are equal."
El se
Display "The values are NOT equal."
End If
End Module
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Database Concepts (8th Edition)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Experiencing MIS
Starting Out with Java: Early Objects (6th Edition)
- #3 – This pseudocode has multiple problems. Fix the calling statement and the definition below so that the routine accepts 3 grades as parameters and returns the average into a variable. Call calcPercentageof(Boolean Number) Module calcPercentageOf (numerator, num2) Set percentage = num / num2 * 100 End Module Write the correct call statement and module definition below:.arrow_forwardCan you find the reason that the following pseudocode does not perform as indicated in thecomments?// Find the error in the following pseudocode.Module main()Declare Real value, result// Get a value from the user.Display "Enter a value."Input value// Get 10 percent of the value.Call tenPercent(value)// Display 10 percent of the value.Display "10 percent of ", value, " is ", resultEnd Modulearrow_forwardPlease convert this C++ code to Java code. REMINDERS: PLEASE refer to the starter code in Java. The output MUST match the picture.arrow_forward
- Needs to be done in C# language. Problem Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: • The number of days spent in the hospital• The daily rate• Hospital medication charges• Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.arrow_forwardFundamentals of Programming in C Language, BASICS ONLY Write the C language statement or statements for each of the following English descriptions in the space provided below each description. Be sure to use proper syntax as needed. Multiply watts times seconds and put the answer in joules_of_energy. (Tip, start your statement with joules_of_energy =......)arrow_forwardThe code should be written and worked out in C programming language only. Please do not write in other programming languages because code sources written in other languages will not work for me. Only use #include <stdio.h> as a header. Please do not use #include <stdlib.h> or other headers.arrow_forward
- Computer Science Python 3 1) It will need to accept user input (At several different points) 2) Each mathematic operation needs to be it's own function/method: Addition - Takes up to 5 arguments Subtraction - - Takes 3 arguments Multiplication - Takes 4 arguments Division - Takes 2 arguments Log - Takes 1 argument Raise a number to a power ex. X squared Solve Pythagorean theorem Factorial 3) Create the ability for a user to use up to 3 of the aforementioned operations together. Example, I can add 5 numbers making result X. I may then take X, and divide it by 4, generating result Y. That's an example of 2, but you get the idea.arrow_forwardPlease write code in c++ . Please follow the instructions given in the question .arrow_forwardUSE C++ programming language 1) State whether the following declarations are valid or invalid. Give reasons for the invalid declarations and draw memory layout for the valid declarations i)int var, *ptr;ptr = &var; ii)float fvar;int *ptr = &fvar;arrow_forward
- n this assignment you will write a computer program from scratch using the Python programming language. This program will function as a simple calculator. Objectives Write a simple Python program that performs arithmetic operations based on the user input Stage 1: A simple calculator Your calculator should provide the following arithmetic and control operations. Arithmetic Operations Addition (+) add(a,b) Subtraction (-) subtract(a,b) Multiplication (*) multiply(a,b) Division (/) divide(a,b) Power (^) power(a,b) Remainder (%) remainder(a,b) Control Operations Terminate (#) Reset ($) Write a function select_op(choice) to select the appropriate mathematics function based on the users selection. The behavior of the program should be as follows: The program should ask the user to specify the desired operation (addition/subtraction/multiplication/division/power/remainder/terminate/reset). You can…arrow_forwardLanguage: JAVA Problem 1: Decimal to Binary Conversion Write a program that takes an integer value as an input and converts that value to its binary representation; for instance, if the user inputs 17, then the output will be 10001. Do not forget to check for valid input, which means if the user inputs a type of data other than an integer re-prompt the user to enter a valid value. The output binary number can be a string. Sample input and output: Enter an integer > a You entered an invalid type. Try again. Enter an integer > 17 10001arrow_forward6. Age Bracket Identifier by CodeChum Admin Cody, our favorite robot, wants to determine if The Programmer is an adult. An adult is anyone aged 18 and above. Input the Programmer's age then print "Adult" if he is an adult and "Minor" if he isn't. Input C++ Programming Make a source code of the problems below using C++ Programming: 1. Programmer's age Output The first line will contain a message prompt to input the Programmer's age. The second line will contain either "Adult" or "Minor". Enter·the·Programmer's·age:·19 Adult 7. Apple Conflict by CodeChum Admin John is back and he wants Cody to compensate for the apple he took from him. Cody decided to give him some apples to ease the tension. Cody thought that John shouldn’t ask for too much. More than 10 is too much while 5 and below is too few. Input the number of apples John wants then print "No way, that's too much" if it reaches more than 10 and print "No, ask for more" if he asks for 5 or below. Print…arrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage