Preprocessor directives begin with which of the following symbol: a. * b. # c. $ d. ! e. None of these.
Q: ?What is wrong with this program -7 int main() {// prints "Hello,World!": cout << "Hello, World!\n"…
A: As per our guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: 2. Refer to the statement below, #include void main(){ int ij: for(i-0;i<5;i++) { for(j-0;j<5;j++){…
A: #include <stdio.h>int main() { int i, j, rows; printf("Enter the number of rows: ");…
Q: Preprocessor directives begin with aA) #B) !C) <D) *E) None of the above
A: Preprocessor directives begin with a
Q: ?What is wrong with this program -7 int main() {// prints "Hello,World!": cout << "Hello,World!\n" }…
A: Here the lines // stands for comments. Thus whatever is there will not be compiled. Now after the…
Q: Q1: What will be the output of the following program? Also explain step by step how it works? CLO-2…
A: To find the output of the given CPP program. The given program has, An integer type variable named…
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: Given the following coding, fill in the blank with the "terms" of function as a comment. #include…
A: Given To complete the comment of the given function.
Q: What happens if the following program is executed in C and C++? #include int main() { foo(); } int…
A: If you run given program in c the when you try to execute c program main function call foo() and it…
Q: Question 7 What should be the output of the below program: int main() int a = 1; switch(a) { case 1:…
A: The program is written in C++ #include<iostream> using namespace std; int main() { int a=1;…
Q: EX4: If X=3.4, Y=2.9, write a Fortran program to read a number and then choose a mathematical…
A: Start Read 2 numbers Read choice If choice is 1 Then result=num1*num2 If choice is 2 Then…
Q: d) Programming langu 3. Which of these data types requires the most amount of storage memory? a. int…
A: Explanation: Answer 3: long requires most storage, then int, then short and then byte. so option A,…
Q: (a) (b) Run the following codes and explain the outputs: main() { } main() { } printf ("\nC to it…
A: C programming language is the machine independent programming language which is mainly used to…
Q: B. Which of these data types requir a. int b. short 4. What is the output after executin
A: 3.long 4.the remainder is2
Q: Code this in C. Project name : Survey Filenames: survey.h, survey.c, main.c Survey Data Analysis…
A: ****THE BELOW CODE IS IMPLEMENTED IN C BY USING DYNAMIC ARRAY*****
Q: plz plz plz .... USING little Man PROGRAM !!!!!!! NOT A programing language (c# , c++ .....) I…
A: the answer is given below:-
Q: Given a final local variable, when must it be given a value O during the declaration O before actual…
A: Actually, variable is the name which is stored in a particular location.
Q: vi. Select the correct methodS provided by Console.In? a) Read(), ReadLine() b) ReadKey(),…
A: vi. Select the correct methodS provided by Console.In? a). Read(), ReadLine() b). ReadKey(),…
Q: A symbolic constant is an identifier that's replaced with replacement text by the C preprocessor…
A: A symbolic constant is a name or identifier that substitutes for a sequence of characters or a…
Q: 6. Construct a program where you input different type of data, output each of them. 7. Construct a…
A: #include <iostream> using namespace std; int main(){ int a=123;//stores integer value…
Q: Which of the following type is provided by C++ but not C? a) int b) bool c) float d) double
A: Given, Choices: int bool float double We have to find which of the given type is provided…
Q: 1. Write a program that will compute the values of r, s, and h given v, w, and z. Use the given…
A: C++ is one of the most widely used programming languages in the world. The basic structure of C++…
Q: give the results of the following statements:
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT…
Q: In which memory segments are the variables in the following code located? Explain your reasoning.…
A: We have a memory layout like below
Q: Drewa flowchart for a program for Huntersville College. The current tuition is $20,000 per year, and…
A: Actually, program is a executable software that runs on a computer.
Q: Preprocessor directives begin with a __________.
A: the preprocessor directives gives instruction to the compiler before the actual compilation begins.…
Q: Which of the following is a function/method of the pickle module? (a) reader() (b) writer() (c) load…
A: Please find the correct answer and detailed explanation in the following steps.
Q: 2- What will be the output of the following code? A=100; if(A>99) clear A; end O A never gets stored…
A: I will explain it in details,
Q: 3. Which of the following is called address operator? a) * b) & c) _ d) %
A: In this question, we are asked the name of address operator. Which one is used as address operator…
Q: Which of the following is correct for a continue statement in Python? O a. Skip the rest of the…
A: Summary:For the given questions from the Python Concepts, choose the correct answer.
Q: Choose the correct answer * The following program contains #include using namespace std; int main…
A: 1. None Because the program in question one contains no comments either line comment or…
Q: Choose the type of error in the following program, if any #include void main() { int a,b;…
A: In this problem we need to design the code in the c++ and need to run and check for the errors.…
Q: Write a C++ program to create a class to read and add two distance in feet and inches.
A: As per our guidelines, only one question will be answered. So, please repost the remaining questions…
Q: (d) int vara; char *ptrvar; ptrvar = vara; (e) Assume int b[ 20 ] = { 0 }, k; for ( k = 0; k <= 20;…
A: (d).
Q: Which of the following statements is not true? Select one: O a. Using function can make a program…
A: According to the Question below the Solution:
Q: Q/In C++, the following expression is an expression "a='x' || b='y' " logical expression O…
A: In programming, an expression is a chunk of code that can be evaluated to a value. A string is a…
Q: Given the program below, fill in the missing code (indicated by blanks). Include a screenshot of a…
A: For the given code, I have provided missing blanks and the required code with the output below.
Q: b. Suppose x, y, and z are int variables and x = 2, y = 6, and z = 10. What will be in the memory…
A: Given: Goal: We have to report the values of x,y, and z after the execution of the statement given.
Q: using namespace std; b. system (cls); c. jum_buf menu; d. #include e. std::cout<<"Hello LJMU
A: Please find the answer below :
Q: Run the following code and explain the difference of the results with comments (each operation step…
A: Postfix expression a-- indicates that the value of a will be decremented by 1 after the evaluation…
Q: QUESTION 3 Define the following: i) #include sb Write a C++ program to caleulate user age where the…
A: C ++ is an object-oriented programming (OOP) language that is considered by many to be the best…
Q: QUESTION 2 #include using namespace std; int main() { int x2, a[3] (3,2,1); cout <<a[1/2] << endl;…
A: The above code is written in C++ And and output is below:
Q: (Important Note: Provide the screen shot of the program (Code) with your name and ID number as a…
A: Solution: Q1. # program to count total number of even and odd elements in an array C# Code:…
Q: write statements to to perform the following actions in C++ write to the text file myfile the string…
A: Required: write statements to to perform the following actions in C++ write to the text file myfile…
Q: Fill in the blanks to give the result of the execution of the following statements:…
A: Required:
Q: 3. Which of the following is called address operator? a) * b) & c)_ d) %
A: Answer :- option B) &
Q: Complete the following Questions of SAS Program: The PROC CONTENTS procedure lists out what…
A: Code is below
Q: What is the output of this program? #include using namespace std; -17 *int main( { int a = 21; int…
A: Question1 : #include <iostream> using namespace std; int main(){ int a=21,c; c=a++;…
Q: d) What is printed when the user enters B? e) What is printed when the user enters C? ) What is…
A: switch case is branching statement that matches switch expression with cases present.
Q: Which of the follow are true about variables? Choose all that apply. variables are names bound to…
A: 1. A variable can eventually be associated with or identified by a memory address. The variable…
Q: 23. For the following code what will be the output: def thing(): print (Hello') print (There) a.…
A: def things(): print('Hello') print('There') Answer: c. There
Preprocessor directives begin with which of the following symbol:
a. *
b. #
c. $
d. !
e. None of these.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Assignment #2 Instructions: Through this programming assignment, the students will learn to do the following: Learn to work with command line options and arguments Gain more experience with Makefiles Gain more experience with Unix Learn to use some of the available math functions available with C Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to perform a mortgage payment calculation. All information needed for this will be passed to the program on the command line. There will be no user input during the execution of the program You will need a few pieces of information. The price of the home and the amount of the down payment. You will also need to know the interest rate and the term of the mortgage. To figure your mortgage payment, start by converting your annual interest rate to a monthly interest rate by dividing by 12. Next, add 1 to the monthly rate. Third, multiply the number of years in the term of the mortgage by 12 to calculate the…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.CPSC 130: Introduction to Computer Programming I Program 3: Decisions In this programming assignment, you will implement two Java programs that deal with decisions. Part1: Determine correct quadrant for angle Complete the program below so that it prompts the user for an angle in degrees, and prints out the quadrant in which the angle is located, represented by Roman numerals, as shown in the following figure. 180⁰ II E III 90⁰ 270⁰ IV Notice that the value of the angle starts at zero degrees at the rightmost point of the circle, moving counterclockwise around the circle as the number of degrees grows. For instance, if the input angle has 100 degrees, it is in quadrant II, while an angle of 300 degrees is in quadrant IV and an angle of 45 degrees is in quadrant I. Each quadrant contains 90 degrees and starts at a multiple of 90. For example, 89 degrees is in quadrant I and 90 degrees is in quadrant II. All the input angle values must be integers between 0 and 359. If the value of an…
- 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:Please circle True or False for each of the following statements. C++ The return type void indicates that a function will perform a task but will not return any information upon completion of that task. TRUE FALSE_______ are variables available only within the body of a declared function. A. Arguments B. Globals C. Parameters D. Locals
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }01. Question Code in Develop a Java program using NetBeans for Codex. Your program should initially display a menu to the user. The menu should have three options, namely (1) Register for a Training Programme (2) Check Registration details (3) Exit Program (see Figure 3 attached). The program should make use of two functions, registerApplicant() for registering a new applicant andsearchDetails() for searching the registrant details. The registerApplicant() function should accept four lines of arguments namely: the registrant’s name, the registrant’s surname, the registrant’s ID number and training programme. It should then write these details to a text file.To write to the text file or retrieve the product details from the text file, you must have a text file to which you write and store the registrant details. Your text file should be named registrants.txt Also, ensure that the program repeatedly shows the menu until the point when option 3 is selected which terminates the program. .C ++ - Create a program that calculates the distance an object travels in meters on Earth for a specific number of seconds. Also calculate the distance traveled on the moon, also in meters, for a specific number of seconds. Do not include any global variables Your program must have the main function and, at least, the following four additional functions. The signatures for these functions must be as follows: double readSeconds() double calculateEarthDistance(double seconds) double calculateMoonDistance(double seconds) void displayResults(double seconds, double earthDistance, double moonDistance) The readSeconds function will be an input function that will read in a double value from cin and return that value back to main. The calculateEarthDistance function will calculate the distance an object falls (on Earth) during the specified number of seconds. The calculateMoonDistance function will calculate the distance an object falls (on the Moon) during the specified number of seconds. The…
- Optional parameters are represented with the following character: a. > b. = c. * d. ! e. ?C++ Visual 2019 A particular talent competition has five judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by dropping the highest and lowest score received, then averaging the three remaining scores. Write a program that uses this method to calculate a contestant's score. It should include the following functions: void getJudgeData() should ask the user for a judge's score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the five judges. void calcScore() should calculate and display the average of the three scores that remain after dropping the highest and lowest scores the performer received. This function should be called just once by main and should be passed the five scores. The last two functions, described below, should be called by calcScore, which uses the returned information to determine which of the…#include <stdio.h>#include <string.h> #pragma warning(disable : 4996) // compiler directive for Visual Studio only // Read before you start:// You are given a partially complete program. Complete the functions in order for this program to work successfully.// All instructions are given above the required functions, please read them and follow them carefully. // You shoud not modify the function return types or parameters.// You can assume that all inputs are valid. Ex: If prompted for an integer, the user will input an integer.// You can use only the strlen() of strings.h library to check string length. Do not use any other string functions // because you are supposed to use pointers for this homework. // **** DO NOT use arrays to store or to index the characters in the string **** // Global Macro Values. They are used to define the size of 2D array of characters#define NUM_STRINGS 4#define STRING_LENGTH 50 // Forward Declarationsvoid…