Reference no: EM13161701
Write a program in C to print your first and last name, ID number, and the mark you hope to get in this course (make one up, it doesn't have to be what you really hope for and it WILL NOT have any influence on your actual mark).
Follow these specifications: Use a define statement to create a constant that will hold your student number. You should have separate string variables for your first and last name; name these first_name and last_name. We will use integer marks, so name the mark you hope for "hope_mark" and the difference between that and 100 "difference".
?Start by asking "Please enter your first name" and then accept the first name into first_name. Do the same for last_name. Next, calculate the number of characters in first and last name and print out "There are xx characters in your first name and xx characters in your last name" replacing xx with the correct numbers. You will now create a list of hope_marks entered along with their difference from 100. We will use a loop, but first tell the user "Enter the mark you hope to get and I'll tell you how far you are from 100 - enter 100 to quit." Print the headings for "Hope Mark" and "Marks from 100" in fields 15 characters wide.
Next, use a while loop to ask for and input a hope_mark. Tell the user to enter a mark between 0 and 100. (For this assignment you do not need to check that the hope_mark is between 0 and 100, although normally you would.) Calculate the difference of the hope_mark from 100. Then print the hope_mark right-aligned in a field 15 characters wide, and the difference left-aligned in a field 15 characters wide. (Do not worry if your compiler gives you a warning about implicit conversion)
If you have done all this correctly, you will notice that the two marks you print run together into what looks like a single number. Figure out how to insert a single space between them WITHOUT changing the field width from 15 characters. If the user enters 100, exit the loop and print "Wow, I hope you DO get perfect!" and end the program by calling the copyright_me() function that you created for assignment 1.??
Use ANSI C comments to show your name and ID number as the first line of the program, as well as the text "Assignment #2." After that, include your answer to Question 1 in the same comment block.
ou should only test hope_mark with numbers from 0 to 100. You should treat any number greater than 99 as 100 for purposes of controlling the loop but for this assignment don't worry about how it affects the variable difference (i.e. calculate difference as if the input were always between 0 and 100). You do not need to verify the input. You will also get odd results if you enter a negative hope_mark, but for this question we will ignore that problem and treat the input as if it was 0 ? 100.
Create a c++ console application
: Objective: Create a C++ console application that will model the characteristics of a resistor. Create a multifile project. Create and add to the project an h file containing the resistor-class definition. Create and add to the project a cpp file cont..
|
Set of strings of balanced parentheses
: Show that the set of strings of balanced parentheses is not defined by any regular expression. Hint: The proof is similar to the proof for the language E above. Suppose that the set of balanced strings had a deterministic finite automaton of m states
|
Application named arithmeticmethods
: Create an application named ArithmeticMethods whose main() method holds two integer variables. Assign values to the variables. In turn, pass each value to methods named displayNumberPlus10()
|
Analyze the potential readability
: Analyze the potential readability problems with using closure reserved words for control statements that are the reverse of the corresponding initial reserved words
|
Use a define statement to create a constant
: Follow these specifications: Use a define statement to create a constant that will hold your student number. You should have separate string variables for your first and last name; name these first_name and last_name.
|
Perform the acyclic-topological sort algorithm
: Perform the acyclic-topological sort algorithm on the directed graph having vertex set a-k and edges {(j; a);(j; g);(a; b);(a; e);(b; c);(c; k);(d; e);(e; c);(e; f);(e; i);(f; k); (g; d);(g; e);(g; h);(h; e);(h; i);(i; f);(i; k)} Show the state of th..
|
Prove by solving the equations using laplace transform
: For a RC circuit, we can use Laplace transforms to show that when we apply a step input of 5V, the voltage across the capacitor rises exponentially to a final value equal to step input.
|
Travelling salesman problem involves
: The Travelling Salesman problem involves a salesman who has to visit a number of cities in a single closed tour. The salesman always starts and ends the tour in his home city and visits each other city on the tour exactly once.
|
Determine the number of bonding electrons
: Determine the number of bonding electrons and the number of nonbonding electrons in the structure of BeF_2 please Enter the number of bonding electrons followed by the number of nonbonding electrons
|