Question 1) What is wrong with the following
Line of code?
char Msg[10];
scanf_s("%s",Msg[0],10);
Answer : Here the mistakes are
as follows :
1) the syntax of scanf which you wrote is wrong
2) In the scanf you call variable along with its size which is
wrong
The profer syntax should be sacnf ("%s", Msg);
Question 2) Create structure for the following Xc parameters: capacitance, frequency, reactance
Answer :
#include <stdio.h>
/* Created a structure here. The name of the structure is
* Xc.
*/
struct Xc{
float capacitance;
float frequency;
float reactance;
};
int main()
{
/* electric is the variable of structure Xc*/
struct Xc electric;
/*Assigning the values of each struct member here*/
electric.capacitance = 8.85;
electric.frequency = 43.0;
electric.reactance = 46.12;
/* Displaying the values of struct members */
printf("Capacitance value is: %d", electric.capacitance);
printf("Frequency value is: %d", electric.frequency);
printf("Reactance value is: %d", electric.reactance);
return 0;
}
Output :
Capacitance value is: 8.85
Frequency value is: 43.0
Reactance value is: 46.12
please answer both the ques Question 12 (1 point) BONUS: (1 mark) What is wrong with...
Please answer both questions thank you. Question 49 (1 point) What is wrong with the following code snippet? for (int i 1; i <= 5; i++) { int squared = i + i; System.out.println(i + IT "! squared = + squared); } System.out.println("Last square = " + squared); calculation error variable scope error O nothing incorrect use of for loop Question 47 (1 point) What are the values of num1 and num2 and result after the execution of mystery (num1,...
please solve, previous ones all wrong! Question 11 1 mark) Attempt 2 What is the Inverse Fourier transform of F(u)- 10-5? Reflection: F-1[F(-u)]=f(-t) Your answer should be expressed as a function of t using the correct syntax. Inverse F.T. is f(t) Question 12 (T mark) Attempt 2 What is the Inverse Fourier transform of: 7 16+iw-4)2 Reflection: F--) Your answer should be expressed as a function of t using the correct syntax. Inverse F.T. is f(t) Question 13 (2 marks)...
QUESTION 1 What will be displayed as a result of executing the following code? int x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points QUESTION 2 What will be the displayed when the following code...
Please answer and explain thank you. Question 1 What will be printed when the following code is executed? double x = 45678.259; System.out.printf("%,.2f", x); Group of answer choices 45678.259 0,045,678.26 45,678.26 45,678.3 Question 2 What will be printed when the following code is executed? double x = 45678.259; String output = String.format("%,.1f", x); System.out.println(output); Group of answer choices 45678.259 45,678.259 45,678.26 45,678.3 Question 3 What will be the value of ans after the following code has been executed? int ans=0;...
Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts What code is human-readable and follows the standards of a programming language? Secret code Source code Key code None of these Machine code Question 3 2 pts What is the symbol that marks the beginning of a one line comment? Question 1 2 pts The preprocessor executes after the compiler. True False Question 5 2 pts A statement that may be used to stop...
Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C - A consecutive group of memory chunks. D - None of the choices. Question 2 How many times is the body of the loop executed? int i=1; while(true) { cout << i; if(++i==5) break; } A - Forever B - 4 C - 5 D - 6 E - 0 Question 3 What is wrong with the following piece of...
Additional code needed: PartA: BurgerOrder class (1 point) Objective: Create a new class that represents an order at a fast-food burger joint. This class will be used in Part B, when we work with a list of orders. As vou work through this part and Part B, draw a UML diagram of each class in using the UML drawing tool 1) Create a new Lab5TestProject project in Netbeans, right-click on the lab5testproject package and select New>Java Class 2) Call your...
Game Description: Most of you have played a very interesting game “Snake” on your old Nokia phones (Black & White). Now it is your time to create it with more interesting colors and features. When the game is started a snake is controlled by up, down, left and right keys to eat food which appears on random locations. By eating food snake’s length increases one unit and player’s score increases by 5 points. Food disappears after 15 seconds and appears...