Assuming X1,X2, Y1 are integer type variables, A,B,C are Bool type variables and Z as real type variable. Check the wrong statements
Q: write test programs in c++ ,java,and c# to determine the scope of a variable declared in a for…
A: PROGRAM CODE: #include<iostream> using namespace std; int main() { int i; int x; for(i=0;…
Q: 2. For Questions 2 (a-c), refer to the declarations and initializations below. Indicate whether each…
A: Answer: As the given code snippet is in C language. In the given code snippet a double array is…
Q: Please fill in the blanks for the following statements: To input a string variable that contains…
A: Actually, we can use string with white spaces by using "scanf %s" function... Which reads the string…
Q: d. Given that an int variable s has been initialized, write a statement(s) that declares a new…
A: d) int s1=(9*(s-8))%4
Q: (b) Evaluate the following expressions and determine the value of all variables, based on the above…
A: Given, int val, h=90, i=8, j=25, j=7; should find values of, i) val = --h % k++ * 2; ii) val = (93+…
Q: Please circle True or False for each of the following statements. C++ Variables of type int are…
A: The given statement is FALSE. The variables of type int are not initialized to the empty string by…
Q: Mark the following statements as true or false and correct the second part if false: 1. The…
A: Note: Since you have posted multiple sub-questions in the same request, we will solve the first…
Q: ASSIGNMENT: Write a C program that will allow the user to enter the inner and outer radii of the…
A: the answer is given below :
Q: How can basic if/else if/else control statements help meet structural design objectives in your…
A: In this question we need to explain how if/else control statements help in meeting structural design…
Q: Write C++ statements that accomplish the following. (6, 7) а. Declare int variables x and y.…
A: Please find the answer below
Q: 2. Refer to the statement below, #include void main(){ int i.j; for(i=0;i<5;i++) {…
A: The given code statement requires some modification in for loop condition to print the given…
Q: Use switch case to write a C++ program that shows three options for the user 1) The first option is…
A: Here we are going to write the coding to compute the area of the circle, cylinder and the triangle…
Q: 5. Determine the type/behavior of the following expressions under static and dynamic typing. a) if…
A: According to the question, we have to determine the type or behavior of the given expression. (a) if…
Q: Declare a primitive variable of type integer named num and assign it the value 14.
A: Declaring and assigning the primitive variable of integer type is given as:
Q: Specifier for input statement for the variable type float is
A: Format Specifiers are used to specify the type of a variable based on its datatype
Q: ) Declare the integer variable z with value 10 without using assignment('=) operator.
A: = is called as assignment operator as it assigns value present at right side to variable at left…
Q: Write C# program for the following: Salman’s basic salary is input through the keyboard, his…
A: Lets see the solution.
Q: Correct the errors in each of the following statements: 1- if ( age >= 65) cout> i>>j; **** *****
A: To correct the errors in the given statements: The given statement is: if ( age >= 65)…
Q: why are the following statements NOT considered to be disjunctive normal form? A * (B + ~C) ~(A +…
A: The answer for the given question is as follows.
Q: Question 2: Write a C program that asks the user to enter several amounts of water consumed in cubic…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: 1. Use a functional decomposition to write a C++ program that asks the user to enter his or her…
A: Below i have given program:
Q: Writer C# program in which accept two number and returns addition and multiplication of value using…
A: using System;using static System.Console; class HelloWorld { static void Main() { //reading two…
Q: b. The function "fractional" divides the numerator by the denominator and returns just t fractional…
A: ALGORITHM:- 1. Check if denominator is 0 the return 0 directly. 2. Else return the fractional part.…
Q: _operator is used to define the reference variable
A: answer is
Q: Consider the following statements/variables in the below scenarlo and calculdle me
A: Given data : Number of constant integers: 7Number of constant floats: 4Number of variables -…
Q: Use functional decomposition to write a C++ program that asks the user to enter his or her weight…
A: PROGRAM: //including essential header files #include <iostream> #include <cstring> using…
Q: Q1) How to write a C program segment that prompts and accepts the age and number of hours the…
A: define 3 constats i.e childrate=1.00, adultrate=3.50 and seniorRate=2.0 take age and number of hours…
Q: Q4:- write a program in c++ language to read the height of cylinder then calculate the volume and…
A: Here is the solution:-
Q: Given the code below: type point real a, b end type type (point) v read*, v z=v%a/v%b print*,…
A: Wrong options none of the given code choices ,because option is there type point real a, b end type…
Q: ne following ray ns are alld If a declaration is valid, write VALID. If it is invalid, you can make…
A: Given : (a)int[50] list;
Q: Suppose that x and y are of type int, z is of type double, and ch is of type char. Consider the…
A: Since x and y are integer type, ch is of type char and z is of type double. Sequence of reading the…
Q: programming language c Exercise Let the following be variable definitions for input. int…
A: #include<stdio.h>int main(){ int length, width; float height; char Shapecode[50] ; int side;…
Q: 20. Give meaningful identifiers for the following variables and write a proper C11 declaration and…
A: The Answer is in step2
Q: def is square(num: int) -> bool: Returns True if is a perfect square. That is, whether there exists…
A:
Q: Write test programs in C++, Java, and C# to determine the scope of a variable declared in a for…
A: #include<iostream> using namespace std; // from here we start our main functions int main() {…
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: to do: Write a program in C++ to calculate and print the Electricity bill of a given customer.…
Q: Q2: An electricity board charges the following rates to domestic users:- Units consumed Tariff Rs. 5…
A:
Q: (Apartment problem) A real estate office handles, say, 50 apartment units. When the rent is, say,…
A: File name: “main.cpp” //Import the header files #include <iostream> #include<iomanip>…
Q: QUESTION 7 Given statements contained a function call. Choose the CORRECT prototype that matches the…
A: In this question asked about the correct prototype that matches the function call given copy(a, b).…
Q: How to use C code to write a C program segment that prompts and accepts the age and number of hours…
A:
Q: Give meaningful identifiers for the following variables and write a proper C++ declaration and…
A: C++ declaration and initialization for the given variables: a. char grade='A';
Q: An Auto Insurance Program Example - Write a C++ program to determine the cost of an…
A: PROGRAM: //Header File #include <iostream> using namespace std; //Defining main int main() {…
Q: Write a program in c++ to check whether the number is palindrome or not.
A: Program Approach - Use the essential header files and define the main function. Declare the…
Q: 1) Run the multiple-target assignment statement below by using C++, Java and Python. Display the…
A: Using C++ :- #include <iostream> using namespace std; int main() { int a,b,c;…
Q: 3. Following is an example of different ways one can declare variables for some programming…
A: following are the possible Regular expressions :
Step by step
Solved in 2 steps
- int a = 9; int c = 6; int d = 6; boolean m; if (a==c && c != d) { m = true}; What is the value of m? True False 6 9Question Using Java programming language write a program to manage a hotel with 24 rooms;10 rooms are Executive, with price Gh ₵ 2500.00 per night,7 rooms are Chalets, with amounts Gh ₵ 1500.00 per night7 rooms are Ordinary, with amount Gh ₵ 500.00 per night The program should allow customers to book for rooms for a number of nights, and update the number of empty rooms available for each category when a customer has paid fully and has checked-in; also update the number of empty rooms available when customer checks-out.Customers should make bookings with their first names, telephone number A customer should be prompted to know if a room is booked (meaning a another customer has booked it but has not paid fully, or has not checked-in) A customer should be prompted to know if a room is occupied (meaning a booked room has been fully paid for, or the customer has checked-in) A customer should be prompted to know if a room is available (meaning a room has neither been booked nor…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.
- IN C++, TRUE OR FALSE : Every if statement must have a corresponding else. C does not provide for the use of classes. The expression !(x > 0) is true only if x is a negative number. C and C++ were both invented in the 1960s. When a return statement executes inside a function, the function immediately exits. A function that changes the value of a variable passed by value also changes the value of the original variable. Both local variables and parameters to a function are stored in memory on the heap.Static Variable: a variable whose lifetime is the lifetime of the program (static int x;) Dynamic Variable: It is a pointer to a variable (int *x;) Is this comparison true?Write a statement that assigns finalValue with the multiplication of userNum1 and userNum2. Ex: If userNum1 is 6 and userNum2 is 2, finalValue is 12. let userNum1 = 6; // Code tested with values: 6 and 4let userNum2 = 2; // Code tested with values: 2 and -2 let finalValue = 0;
- What value will be returned by the function if a = 8, b=12? %3D int func(int a, int b){ if(a>b){ return a+b; } else if(aSuppose that you have the following definitions: struct timeType{ int hr; double min; int sec; }; struct tourType{ string cityName; int distance; timeType travelTime;}; Using C++ ... Declare the variable destination of type tourType. Write C++ statements to store the following data in destination: cityName—Chicago, distance—550 miles, travelTime—9 hours and 30 minutes. Write the definition of a function to output the data stored in a variable of type tourType. Write the definition of a value-returning function that inputs data into a variable of type tourType. Write the definition of a void function with a reference parameter of type tourType to input data in a variable of type tourType.Admission Write a C++ program that: Define a void function named Admission() with two parameters. The function accepts two arguments: a student’s high school grade point average (for example, GPA is 3.2) and an admission test score (for example, 83). The function then displays a message “Accepted” if the student has any of the following: A GPA of 3.6 or above and an admission test score of at least 60. A GPA of 3.0 or above and an admission test score of at least 70. A GPA of 2.6 or above and an admission test score of at least 80. A GPA of 2.0 or above and an admission test score of at least 90. If the student does not meet any of the qualifications, the function should display a message “Rejected”. //for example, here is the function header: void admission (double gpa, int score) Write a function prototype statement for function Admission before the main function, and add function definition after the main function in the program. In the main function, prompts user to enter a…Hello good afternoon, Use functional decomposition to write a C++ program that asks the user to enter his or herweight and the name of a planet. Use an enumerated type called planetType to represent theplanets and use a switch statement that takes as its condition a planetType variable. The program,via the switch statement, then outputs how much the user would weigh on that planet. Thefollowing table gives the factor by which the weight must be multiplied for each planet.Your program must have the following functions in it: GetUserInput(),ConvertInputToPlanetType(), and OutputWeight() (your switch statement must be inOutputWeight()). I will let you determine what each function’s parameters and return typesshould be. The program will output an error message if the user does not type a correct planetname. The prompt and the error message will make it clear to the user how a planet name mustbe entered.Use proper formatting and appropriate comments in your code. The output must be…SLA malicious threat is always from human threat source.S2:As much no two human beings are alike in DNA composition, no two organizations are alike in IT environments. A. Both Statements are trueB. Only the first statement is trueC. Only the second statement is trueD. None of the statements are truequestion 2: write a program in c++ to handle the following scenario: three friends asif, shahid and bashir start the business. input following from user. enter amount invested by asif (user will enter any value) bashir’s contribution is equal to 250% of asif’s contribution and shahid’s contribution is equal to 75% of bashir’s contribution. display amount contributed by bashir and shahid. after 6 months business earned profit of 50% of total investment. display the total profit and the amount each sharer will get (i.e. distribute profit as per percentage of their investment).SEE MORE QUESTIONS