Java beginer

Unit 1 Graded 1
1. Please explain what is happening with each line of coding syntax in the programming shell
template up above.
1. The first line instructs the preprocessor to take account of the contents of
the standard input/output header (<stdio.h>) in the program
2. The next line is the main function
3. Then it goes to the function/programing.
2. What is meant by declaring a variable? What is a data type and why do we assign one to a
variable? What are some great variable naming conventions? What can we not include in a
variable name?
1. It means that you are setting up and stating what kind of input/variable you are going
to be using. A data type is what kind of data is going to be used, integer or something
else. Integer1 and interger2 are good ones for example. No special symbols or
reserved words should be used.
3. What is the difference between the scanf() and printf() functions? What is the syntax that is
needed for both types of statements? Please provide a coding sample of each.
Printf is for writing output. scanf is for reading input.
scanf(format_string, list_of_variable_addresses);
printf("FSU has %d students", numStudents);
4. What is the difference between a decisional statement and a looping structure? Which one
includes increment or decrement operators and what is their function?
1. looping statement will be executed repeatedaly until the condition becomes false.
Decision statment have only one entry point but must have two exit points since
the answer to the question can be either a "YES" or a "NO". A looping does the
latter
5. Please provide a real world example of both a decisional statement and a looping structure and
include a coding snippet with your written examples.
For decisional statement this could be “Do you want pancakes?”
puts( Pancakewant = “yes ? "Eat them up" : "Maybe next time" );
For a looping structure one could be “Has the total reached 10?”
for ( int x = 0; x < 10; x++ )
Part 2
1.
#include <stdio.h>
int main(void)
{
int number1; //variable declaration
printf("Enter number1: "); //prompt
scanf_s("%d", &number1);
printf("Number1 is %d", number1); //display text and value stored in number1
printf("\n"); // displays new line
return 0; //terminates program
}
//The & was not with number1
2.
#include <stdio.h>
int main()
{
int radius;
int diameter;//variable declarations
printf("Enter radius: "); //prompt
scanf_s("%d", &radius); //store user input for radius
diameter = radius * 2; // assignment statement to stroe diamter computation
printf("The Radius is :%d \n", radius); //display radisu to ouput screen
printf("The Diameter is:%d \n", diameter); //display diamter to output screen
return 0;
}
3.
#include <stdio.h>
int main()
{
int PI = 3.14;
int radius;
int area;
printf("Enter radius: "); //prompt
scanf_s("%d", &radius);
area = PI * radius * radius; // assignment statement to compute area
printf("The radius is: %d\n", radius);
printf("The Area is: %d\n", area);
return 0;
}
4.
#include <stdio.h>
int main()
{
int grade = 76;
if (grade >= 60){
printf("Passed\n");
}
else
{
printf("Failed\n");
}
return 0;
}
5.
#include <stdio.h>
int main()
{
int count = 2;
while (count > 0){
printf("Continue\n");
count = count - 1;
}
printf("Stop\n");
return 0;
}

Place new order. It's free, fast and safe

-+
550 words

Our customers say

Customer Avatar
Jeff Curtis
USA, Student

"I'm fully satisfied with the essay I've just received. When I read it, I felt like it was exactly what I wanted to say, but couldn’t find the necessary words. Thank you!"

Customer Avatar
Ian McGregor
UK, Student

"I don’t know what I would do without your assistance! With your help, I met my deadline just in time and the work was very professional. I will be back in several days with another assignment!"

Customer Avatar
Shannon Williams
Canada, Student

"It was the perfect experience! I enjoyed working with my writer, he delivered my work on time and followed all the guidelines about the referencing and contents."

  • 5-paragraph Essay
  • Admission Essay
  • Annotated Bibliography
  • Argumentative Essay
  • Article Review
  • Assignment
  • Biography
  • Book/Movie Review
  • Business Plan
  • Case Study
  • Cause and Effect Essay
  • Classification Essay
  • Comparison Essay
  • Coursework
  • Creative Writing
  • Critical Thinking/Review
  • Deductive Essay
  • Definition Essay
  • Essay (Any Type)
  • Exploratory Essay
  • Expository Essay
  • Informal Essay
  • Literature Essay
  • Multiple Choice Question
  • Narrative Essay
  • Personal Essay
  • Persuasive Essay
  • Powerpoint Presentation
  • Reflective Writing
  • Research Essay
  • Response Essay
  • Scholarship Essay
  • Term Paper
We use cookies to provide you with the best possible experience. By using this website you are accepting the use of cookies mentioned in our Privacy Policy.