4/ Which of the following is used for comments in C++? B. /* comment */ D. // comment A. I/ comment C. both // comment or /* comment */ 5/ The modulus operator uses A. + character. C./ B. * D. % 6/ Variable names must begin with A. letter В. S C. number D. #
Q: 1L + 2+ 3.0 Select the correct data type that the above expression evaluates to in C# O int Olong…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: 1L + 2.0F + 3.0 Select the correct data type that the above expression evaluates to in C# O int long…
A: Given expression is, 1L + 2.0F +3.0 L represents long data type. That means 1 is long. F represents…
Q: Q.5) Write a C++ code that asks the user's name , then the code will ask the user to guess the…
A: #include <iostream>using namespace std;int main(){ //varibale to hold name string name;…
Q: Which pair of values for a and b will the following code NOT print any value? #include using…
A: For a=1 b=2 Switch(a*b) Switch(1*2) Switch(2) goes to case 2 ,here first line of case 2 we have.…
Q: 6. Write a flowchart that display a series of number (5-23) in descending order.
A: Start -> Declare variable i=23 -> Run loop from i=23 to i=5 each time loop run decrease…
Q: <include <iostream# ;using namespace std () int main } ;int x=2, y=2, a=2, b32,g=2,j=2,i=2 g != 5…
A:
Q: Q1-Use ? operator to write C++ program to find the value of the variable Z if you know that.(do not…
A: ? is called as ternary operator This return s the first expression if condition is true or else…
Q: 1) Which of the following assignment statements will cause errors. Copy and paste it in C++ editor…
A: The following assignment statements will cause errors, e = "h"; e = "def";
Q: Consider the following flowchart: false false false n==0 n==1 print('D') true true true print('A')…
A: Please find the answer below :
Q: program Credit Card Validator - Takes in a credit card number from a common credit card vendor…
A: Number must be of 13 to 16 digits Number starts with 4 for Visa cards 5 for Master cards 37 for…
Q: What will the following Code segment print on the screen?
A: The output of the above java program will be :
Q: What is the output of the C Code? int x: x=(3<2) ? 10:20; printf("%d",x);
A: ternary operator: It is used to execute code based on the result of a binary condition.
Q: 2. In this assignment, find the output of the C++ prog given below. #3include using namespace std;…
A: We are given a C++ code and we are going to find out its output.
Q: c++ code Also in code i am getting "sh: 1: PAUSE: not found" Write a program that reads in a line…
A: It seems the error sh 1: pause not found is irrelevant to the program. And you can go ahead and…
Q: Question: What is the output of the program? #include using namespace std; int main() {…
A: Let us see the answer below.
Q: What is the output of the following program? #include using namespace std; main() {…
A: Question. What is the output of the following program? #include<iostream> using…
Q: 2- For inserting a new line in C++ pro which one of the following statement e used?
A: Lets see the solution.
Q: One of the following statement -10 is wrong a- int 1no; O b-a+=b; C c-cout<<"hello"; d- /* comment ;…
A: (Sorry Dear ! As per Bartleby guidelines we are restricted to answer only one question (& 3…
Q: Create a flowchart that will accept three unique integers and print the sum, product and the average…
A: STEP 1 Start STEP 2 Read A, B, C STEP 3 COMPUTE Sum = A+ B + C STEP 4 COMPUTE Prod =…
Q: 2- Write a program that accepts a user-entered number and calculates the square. Before calculating,…
A: Actually, c++ is a powerful general purpose language. It is a high level language.
Q: (b) Show what the programmer can view from the console by inserting number 33 and number 77 for the…
A: Code: #include <iostream>using namespace std; int main ( ){int choice;int a = 33, b = 55, c =…
Q: correct the code and and identify the name of error in the below code? String number = “1”; switch…
A: Java code: public class Main{ public static void main(String[] args) { String number =…
Q: What will be the output of code given below. #include using namespace std; int main() { char…
A: We are given a char variable ch with value 'x', when we cout &ch, then it will print the value…
Q: (B)What should be printed on C++ screen? #include void main() { int x = 5; if(x++ == 5)…
A: Explanation: iostream.h is a header file which contains defalut functions like cout ,cin . Here you…
Q: B) Replace switch.case with nested if.else statement? #include<iostream using namespace std; int…
A:
Q: A B IUDv A v Ap ... Write a Python program in which the user enters either 'A', 'a', 'B', 'b', 'C'…
A: logic:- Display “——Problem 3: Practice nested if statement——-“ Read user input choice using input…
Q: 2- Write a programC++ to receive an arithmetic operator and two integers, the program performs the…
A: code:-- #include <iostream>using namespace std; // function to calculate the arithmatic…
Q: Variables 'a' in main function and 'a' in test function are using the same memory location, True or…
A: Every variable is a memory location and every memory location has its address defined which can be…
Q: Q1-Use ? operator to write C++ program to find the value of the variable Z if you know that.(do not…
A: GIVEN:
Q: Which of the following choices represents what may print from line 2 after the following C++ code…
A: option c will be printed. 130 003FR8A0 130
Q: 2. Write a code that accepts a number from the user using input command and display the word "…
A: Note : since programming language is not mention we are providing solution in PYTHON programming.
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: using System; class Program { publicstaticvoid Main(string[] args) { int number,max=-9999999; while…
A: Given:
Q: Q6) Write a program that calculates the factorial of a positive integer, factorial of zero is one.…
A: As the language is not specified answer written in c++
Q: Q1) How to use C code to write a C program segment to prompt a user for entering an integer and save…
A: use while infinite loop to display warning message until user choose option as 1 , 2 or 3.
Q: 4) Write a program that displays the following type of triangles. Size of triangle will be entered…
A: Find the code below.
Q: What will be the output of the following C++ code? #include using namespace std; enum…
A: Dear Student, enum will increment the value in A and store it in B , and again it will enumerate the…
Q: 19. Which of the following functions is a character-changing function? a.. toupper () b. isdigit ()…
A:
Q: Which of the following options is rigth for the following declaration: string *x.y, Select one: ay…
A: Question :-
Q: a) Write Python statement that strips of characters and prints the word 'Python' b) Write Python…
A: Python used to answer this question
Q: 3) Write a program that displays the following type of triangles. Size of triangle will be entered…
A: The code is given below:-
Q: What will be the output of the following program? #include #include using namespace std;…
A: Question. What will be the output of the following program? #include<iostream>…
Q: Write a C# statement to declare a variable mykcc of Account type, use "Mary" as the account name and…
A: 1. Account myAcc = new Account("Mary",500); 2. Console.WriteLine("Please enter a decimal number");…
Q: Q1-Use ? operator to write C++ program to find the value of the variable Z if you know that.(do not…
A: Algorithm : Step 1 : declare variables. Step 2 : ask for the value of A from user. Step 3 : ask for…
Q: iMobile.cpp iMobile is a mobile phone service company that offers three different data plans to its…
A: #include <iostream>#include <string>#include <cmath>using namespace std;int…
Q: What logical operator you will use so that the statements will be performed, if you have atleast one…
A: I have answered both the question and for the 2nd question I am also attaching screenshot to verify…
Q: What is the output of the following C++ code? int num = 1;while (num * num <= 50){cout <<…
A: PROGRAM: //Header file #include <iostream> //Using namespace using namespace std; //Defining…
Q: 1. To print a new line in an fprintf statement, you must use which of the following expressions? A.…
A: Sample code
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.
Step by step
Solved in 2 steps
- C++ Coding Question: A car's odometer tells you how far (in miles) you traveled. Each number is displayed in its own “window” and the odometer counts up when you drive. Write a C++ program that reproduces a digital odometer. It has 10 “windows” and will output the miles as you travel, starting at 0000000000 and ending at 9999999999 (after which you probably want to sell the car anyway …).Which one of the following is the correct form of a comment statement in C++? */ Comments */ ** Comment ** /* Comment */ O { Comment}Please select all the valid comments in C++. /comment /***/ */comment/* O /comment O *****comment*******/ O/"comment/ « Previous
- C++ Election Day Write a program that compiles the result of an election. You will read the candidate last names from ballot.txt(also provided with the starter code). The ballot can have up to 10 people on it. For each candidate, prompt the user for the total number of votes they got in the election. You should calculate the total votes cast and the % of the vote each candidate earned. Display to the console a report showing the candidate name, the number votes received, and the percent of the total vote. You should also display the total votes cast and the winner. INPUT VALIDATION: Make sure the votes cast is greater than or equal to 0, and that it is a number. Sample output:C++ OOP Write a program that does the following:• Prompts the user to input five decimal numbers.• Prints the five decimal numbers.• Converts each decimal number to the nearest integer.• Adds the five integers.• Prints the sum and average of the five integers.C++ Coding: Functions Question:Write a program that requests a weight number in pounds (lb). Write a function that converts the weight to grams (g) and ounces (oz). Output: Enter the weight of your item in pounds (lb) or enter zero to end the program: -1 Please enter a positive value. Try again. Enter the weight of your item in pounds (lb) or enter zero to end the program: 32.32 32.32 lb = 14660.1054 g 32.32 lb = 517.12 oz Enter the weight of your item in pounds (lb) or enter zero to end the program: 0 Exit program. Goodbye!
- 38. To pass a scalar variable by reference in C++, you need to include the ____ operator before the formal parameter’s name in the receiving function’s header. a. & c. $ b. * d. @ 42. A simple, or ____ variable, is one that is unrelated to any other variable in memory. a. scalar b. vector c. independent d. dependent 43. You may use an assignment statement or the ____ operator to enter data into an array element. a. comparison b. arithmetic c. extraction d. insertion 44. Each of the ____ (variables) in an array has the same data type. a.elements b.objects c.structures d.subscriptsAssignment #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…Q2: (Debugging Code) : As you are learning to program in C, you will often spend a lot of time debugging code and finding errors. It takes a lot of practice to develop this skill. There are many errors in the following program. Find and correct all the errors so that the program compiles and produces the correct output. (Add a new comment on line 1 of the code and list the errors.) Find all the errors challenge * includeThese are C# programming questions, I need some help please. Q 6: Declare a variable to store Social Security Number and assign value 056-78-1234 to it. Q7: Declare a variable to store a Middle Initial (one letter) and assign any middle initial to it. Q3: Explain what is wrong with the code fragment below. const double SALES_TAX= 0.08; SALES_TAX = 0.86;C++ Programming Problem: To make telephone numbers easier to remember, some companies use letters to show their telephone number. For example, using letters, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone number meaningful, companies might use more than seven letters. For example, 255-5466 can be displayed as CALL HOME, which uses eight letters. Write a program that prompts the user to enter a telephone number expressed in letters and outputs the corresponding telephone number in digits. If the user enters more than seven letters, then process only the first seven letters. Also output the hyphen after the third digit. Allow the user to use both uppercase and lowercase letters as well as spaces between words. Moreover, your program should process as many telephone numbers as the user wants.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 funtions available with C Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to perform the 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…SEE MORE QUESTIONS