In the following program, rewrite the line that contains syntax error in the correct 1. #include 2. #include cmath 3. #include 4. using namespace std 5. 6. main() 7. 8. string country 1= "Kuwait"; %3D 9. string Country_2 = "USA";
Q: ?What is the output of the following code #include using namespace std; int main() { char ch[5] =…
A: GIVEN:
Q: in this code, the integer on each line shows the line number that is not part of code: what is he…
A: Answer:- Variable x, y and z are the local variables of sum function. Here parameters are also…
Q: 12 - final question Choose the correct set of statements to set all textbox values in the Form to…
A: TextBox is an important component of Windows forms. The user can enter data into the application…
Q: str1 = "Low", str2 = "High", and str3 = "Medium". Evaluate the following expressions. (2, 7) str1…
A: String comparison in Python can be performed using the equality (==) and the comparison (<, >,…
Q: Given the following variable declaration, choose the option that describes them…
A: A variable is an identifier that values can be changeable. It works like a container, that can store…
Q: Which line in the following program contains the header for the showDub function? 1 #include 2…
A: A function header is a declaration of function. A function header tells the compiler about three…
Q: What will the following program display? #include using namespace std; int main() { int unus, duo,…
A: GIVEN: What will the following program display? #include using namespace std; int main() { int unus,…
Q: 1.Given the following declarations, evaluate the expression below and assign true or false value for…
A: In step 2 I am giving the Source code in C language, as there is no particular language mentioned…
Q: What will the following Code segment print on the screen?
A: The output of the above java program will be :
Q: Write a code under Button named "ToUpper" , By clicking the button, transfer all items listed in…
A: ANSWER: Program: Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles…
Q: What will be the output if all necessary code is included (Header files and main function)? void…
A: Here in main() method we create a Object x which contain null Object x=null; Now we pass this…
Q: Show what the program segment would display on the screen. int x = 2; int y = 4; cout << x++ << --y…
A: Program- Output-
Q: Question 15 What is the type of error in the following program 1 #include 2 using namespace std; 3\…
A: ERRORS AND THEIR TYPES: Following are the lines that have errors in the program code: float…
Q: The following program is used in a bookstore to determine how many discount coupons a customer gets.…
A: #include <iostream> using namespace std; int main(){int numBooks, numCoupons;cout <<…
Q: What is the output of the following C++ code? string str1 = "sunny";string str2 = "cloudy";string…
A: code: #include <iostream> using namespace std; int main() { //assign a string string str1 =…
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: What will the following statement display?print('George', 'John', 'Paul', 'Ringo', sep='@')
A: Given: What will the following statement display?print('George', 'John', 'Paul', 'Ringo', sep='@')
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: Read the code shown below carefully and pick what can be printed? a = {"Craig":10, "Sizwe":20}…
A: Given code is a = {"Craig":10, "Sizwe":20} print a Here a can store the array of values.
Q: 1. Write a program that takes as input a single character and will print both the input letter grade…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: 3.8 Declare a string variable containing the name of your favorite color, initialize it as a null…
A: INTRODUCTION: The variable length strings can have as numerous characters as required. For the…
Q: 4. A variable should hold all the letters of the alphabet. Which data type should the variable be?…
A: GIVEN: 4. A variable should hold all the letters of the alphabet. Which data type should the…
Q: When is a typedef statement necessary? a. It's never necessary, it's just a good tool to use O b.…
A: Typedef: The typedef feature of the programming language allows us to establish an alias or new name…
Q: what is each line of the code below do? #include "mbed.h" #include "Servo.h" #include "Map.hpp" 1.…
A: Below i have answered in comments:
Q: What is the output of the program? #include using namespace std; void trick (int *templ, int…
A: Given: Only answer, no need of explanation
Q: What is the value of the variable named len after the code that follows is executed?int[][] nums = {…
A: What is the value of the variable named len after the code that follows is executed?int[][] nums = {…
Q: What will the following C++ code output in the snippet? #include #include using namespace std; int…
A: Given, Code: #include <iomanip> #include <iostream> using namespace std; int main()…
Q: double num1 = 1234567.456, num2 = 123.456, num3 = 123.456, num4 = 123456.789; int num5 = 123456;…
A: [Note: In the below-given program code, single quotes are used to display the padding field.]…
Q: What is the output of the program? #include using namespace std; void trick (int *templ, int…
A: EXPLANATION: Initially the variable stores the following values: a=100 b=200 c=300 Now, for the…
Q: 4. Write C++ programs that displays patterns as shown below: a. AU AU AU AU AU AU AU AU AU AU AU AU…
A: According to the Question below the complete Program: First Pattern Output: Second Pattern…
Q: Please comment all of the following code by using multiple line comment symbol. 1/1 int main() {…
A: Commenting the line of code with multiple line comment in c++
Q: What will the following segment of code output if the value 11 is entered at the keyboard? int…
A: According to the Question Complete Solution in Step 2 and Step 3
Q: What is the output of the following code? #include <iostream>#include <string> using…
A: Sample output: DEFG DEFG
Q: int numl, num2, num3; double length, width, height; double volume; numl = 6; num2 = 7; num3 = 4; %3D…
A: a. Given statement: volume =box(length, width, height); Here, "box" is the method which is passed…
Q: prototype d FindAreaCircum (double radius, double *area, double *circum); used and the circumference…
A: GIVEN: 1) Edit the given code for radius=3.5 b) Modify the code and find the area and volume of the…
Q: function phone (inputtext) { var phonenum = /^\d{8}$/; if(inputtext.value.match(phonenum)) { return…
A: The answer is b.8 Given code var phonenum = /^\d{8}$/ indicates phone number should contain 8…
Q: int numl, num2, num3; double length, width, height; double volume; numl = 6; num2 = 7; num3 = 4;…
A: volume = box(length, width, height); valid. volume = box(length, 3.8, height); valid. cout…
Q: following the code below, the output will be string[] names= {"Khalid", "Ahmad", "Sami", "Ali"};…
A: Answer: Explanation: The square brackets here mean that this is an array. Now to access a value…
Q: Modify the following code to do the following when the the paragraph is clicked: Prompt the user to…
A: <!DOCTYPE html><html><body><button onclick="myFunction()">Enter first…
Q: In the following program, rewrite the line that contains syntax error (errors) in the correct way in…
A: Task :- identify the syntax errors in the code.
Q: You want to execute a block of code only if age equals 65. Which of these versions would be the…
A: Block of code in a programming A block of code contains a set of the statements enclosed within…
Q: The output of the following program is to draw a group of stars in the form of #include void main(){…
A: The program will used to draw a group of stars in the form of triangle. We have use two variables…
Q: What is wrong with the following code? #include using namespace std; void displayString (string);…
A: Function displyString(string) has return type of Void and it takes a String parameter. But when…
Q: (b) void yes(string &my_string) { my_string += "YES!"; int main() string my_string = "Did you wash…
A: phi(1) is 1 phi(2) is 1.0+1.0/1 = 2 phi(3) is 1.0+1.0/2=1.5 phi(4) is 1.0+1.0/1.5=1.66667 In main,…
Q: If str=‟Long String”, what will be the value of the following variables: String…
A: Value of variables are: str = Long String str1 = g Str str2 = Lon test = false
Q: Nhat is wrong with the following code? #include using namespace std; void displayString (string);…
A: Given: #include <iostream> using namespace std; void displayString(string) int main() {…
Q: In the tollowing program, rewrite the line that contains syntax error (errors) in the correct way in…
A: Line 3: string was not declared, line should be written as using namespace std; Line 4: # (hash)…
Q: QUESTION 10 Choose the correct statement. a. The String method substring returns a char. b. The…
A: Answer: d. The String method substring returns a String.
Q: What is the output of the program? #include using namespace std; void trick (int *templ, int…
A: Please check the solution below.
Q: Yname is a string variable, and Yname = "Type your full name in English". * Your answer This is a…
A: Here, your have to input just a name of your. Yname is a string variable and Yname = "Type your…
Step by step
Solved in 2 steps
- T/F 7. You can use, >, ==,!=, =, >= to match int, float, and double variables, but you must use compareTo(), equals(), and equalsIgnoreCase to compare char and String variables ().In Germany, the house number is displayed after the street name; for example, Bahnhofstraße 1. Change the print_address function from this section so that it can print addresses in either format. address.cpp 1 #include 2 #include 3 using namespace std; 4 5 struct StreetAddress 6 { 7 8 9 }; 10 11 void print_address (StreetAddress address, bool number_first) 12 { 13 14 } Tester.cpp 1 #include 2 #include 4 5 6 { 7 8 9 10 int house_number; string street_name; using namespace std; PARTNE56 struct StreetAddress }; 19 11 void print_address (StreetAddress address, bool number_first); 12 13 int main() 14 { int house number; string street_name; 15 16 white_house.house_number = 1600; 17 white_house.street_name = "Pennsylvania Avenue"; 18 StreetAddress white_house; CodeCheck print_address (white_house, true); cout << endl<<< "Expected: 1600 Pennsylvania Avenue" << endl; 20 StreetAddress train station; train station. house number = 1; train station.street_name = "Bahnhofstraße"; 21 22 23…Assignment Content Write a program that lets the user enter the coordinates of the center and radius of two circles, circle 1 with center coordinates at (* Y1 and circle 2 with center coordinates at (X y,). The program then determines whether circle 2 is inside circle 1 or overlaps with circle 1. rl rl • (x1, y1) (x1, y1) (x2, y2), (x2, y2) Circle 2 is found to be inside circle 1 if distance between the centers is <=Tradius circle1 - radius cirede and circle 2 is said to overlap circle one if the distance between the two centers is <=radius circle1 + radius circle2- Test Cases: Enter center coordinates (x, y) and radius of circle 1:0.5 5.1 13 Enter center coordinates (x, y) and radius of circle 2:11.7 4.5 Circle 2 is inside of circle 1 Enter center coordinates (x, y) and radius of circle 1:3 75.5 Enter center coordinates (x, y) and radius of circle 2: 6.7 3.5 3 Circle 2 overlaps circle 1 Enter center coordinates (x, y) and radius of circle 1:3.55.5 1 Enter center coordinates (x, y) and…
- C++ Language Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is : F=9/5*C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. The formula for the conversion from Celsius to Newton is C = 100/33*N N is the Newton Temperature and C is the Celsius temperature Your program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places. INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater…2. What data type would you use to allow a function to receive an Int or nil value as its parameter? func display(num: ____ ) { if num == nil { print("Not a number") } else { print(num) } } display(num: 5) display(num: nil)Programming Assignment: Car Repair For this programming assignment, create a car repair program that prompts the user to enter information about a customer, the customer's vehicle, and the work performed on the customer's vehicle. Your program should then display the final car repair bill on the computer screen. Your program should accomplish the following: 1. Prompt the user to enter the following information: a. Information about the customer (name, street address, city, state, zip code, phone number). b. Information about the customer's vehicle (make, model, year). c. Information about the work performed (brief description, labor hours needed, cost of parts). 2. Use a labor cost amount of $100.00 per hour and a sales tax rate of 7.0%. 3. Calculate the following: Variable subtotal sales tax total repair bill amount Formula subtotal = labor cost per hour * number of labor hours sales tax = sales tax rate * subtotal total repair bill amount = subtotal + sales tax 4. A screen shot of a…
- Programming Assignment Create a program application using C#, C++, or your preferred software for a small Employee Payroll system using one dimensional arrays. Include the following for at least 5 employees for a period of 3 months (assume the employees are paid monthly) a. hourly wages b. monthly earnings c. annual earnings d. monthly deductions (look the basic deductions) e. annual deductions f. net pay g. gross payError; the string "int16_t" and "int8_t" must occur somewhere in your code. where to put those string into he code Here is my code: #include <stdio.h> typedef struct define { short mantissa; char exponent; } Float24_t;1. A structure should be used if the data structure has only fields, no methods, and security is not a high priority. a. true b. false 2. Which of the following can contain items of different data types? a. An array b. A structure c. A string
- Rest of code in image / This is a bad programming style since it is using goto. // This is an spagetti code and not working.// Use function to display menu, and display game rules,// Use different color for text display.// fix it so it works any way you like./*HANDLE screen = GetStdHandle(STD_OUTPUT_HANDLE); // Write 16 lines in 16 different colors. for (int color = 0; color < 16; color++) { SetConsoleTextAttribute (screen, color); cout << " Hello World!" << endl; Sleep(400); // Pause between lines to watch them appear } // Restore the normal text color) SetConsoleTextAttribute(screen, 7);*/#include <iostream>#include <windows.h>using namespace std;int main(){ //textbackground(WHITE); //textcolor(RED); system("cls"); char ch, a[20], ch2; int num = 100, rnum, guess, count, ch1, c = 0; cout << "**********************************************************"<<endl; cout << "*…C++: Describe how the following call by reference works. Make a comment for each line. void pxc(int& c, int& d) { int k = c; c = d; d = k; } int main() { int a = 15, b = 100; pxc(a, b); }Program Three: Lists and Dictionaries Welcome to Andy's Cornish Pasties! Pasty3.py You need copy Pasty2.py and make the following changes: How many pasties are you buying today? 3 What flavor is pasty #1 Beef & Potato Ask how many pasties are being purchased. 1. What price is pasty #1 5.75 What flavor is pasty #2 Pea & Potato What price is pasty #2 3.75 What flavor is pasty #3 Chicken & Potato Use a loop to ask for the flavor and price of each pasty. These will be put into a list or a dictionary. 2. What price is pasty #3 4.75 The total price of your pasties is $ 13.25 Enter tip % that you want to give Andy: 10 Tax and tip are both based on the total pasty price. 3. Invoice Due $ 5.75 $ 3.75 $ 4.75 $14.25 $ 1.00 $15.25 $ 1.43 Beef & Potato Pasty Pea & Potato Chicken & Potato 4. Format the output as shown. Pasty Price Tax @ 7.025% Subtotal Tip @ 10.0% Today's total Would you like to place another order? y or n:n $16.68 Thanks for enjoying pasties from Cornwall!