Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

explain each of these questions and examples of how they can be answered. Eile E

ID: 3783847 • Letter: E

Question

explain each of these questions and examples of how they can be answered.

Eile Edit Yew Hbtory Bookmarks bols Help a student Access to Cam. X Sakai@URI: CSC 110 Spr... X Sakai URI: 2 G what M Inbox 0,920) jeffrey du- X PeopleSoft session expired ELIF..ELSE Stat e a jill long uri https sakai. uriedu/p ortal/sitele3dbb580-1615-4901-aff0-88196032a87c/page/03556327-a826-4a THE a Logo! UNIVERSITY 21"ENG1100000: ntr My Workspace CSC 110 Spring 2017 v OF RHODE ISLAND 2171-BUS2020004: Mana More Sites Home s CSC 110 Spring 2017: Announcements syllabus L Preneous Return toust. Next> Announcements Announcement Weekly course Subject Review Quiz on T Saved By Liisa Dipippo Assignments Modified Date Jan 25, 2017 8:45 am site Message a reminder that there will be a short quiz tomorrow (Thu) in CSC 0 to assess how much you recall from your prior programming cla wil be in Ja pot, but r you ow another language better you ould not have a problem reading the Javascript Great Algorithms a And for the questions that ask you to write codo, you can use whatever language you want. Here is an overview of what to expect on the quiz: Programming There will be a question at asks you to specify the output of a short program at uses an eise statement. Make sure you understand how to follow the logic ofthis kind of conditional statement. sample Code 2) There wil be a question that asks you to specity the output of a short program that uses a while loop. Be sure you understand how to trace the logicot a loop to koop track of the valuosof the variables in theloop asking you to gnize the difference between a while loop da for loop. You ld be le to vert code that for loo de that ile loop, and There will be a question at asks you to trace e logic of a function call You should understand how the formal parameters are defined in the function and how the values are passed to the unction. CSC Links 5) Thore wil be a question that asks you to write a simplo 1unctiongiven the codo that will go inside the function Schedule If yo of any of s, go back to you otes and videos from Khan Academy d revisit th topics. wil have office hours Thursday 9230- if you have any questions. Gradebook E s Prevous Return to ust Next University Course Help 2017 University of Rhode Island. Al ights reserved. URI is an equal opportunity employ to the principles TRUNK Sakal 10-5NAPShtOT (Kernel 10-SNAPSHOT) Server ut 04 Senner Time

Explanation / Answer

1.) General syntax of if-else:

if(condition)

{

//statements

}

else

{

//statements

}

If else statement works on a logic that either statements inside the if block will execute or statements inside else block. If condition evaluates to true then statements inside if block will be executed otherwise else statement will be executed.

2.) syntax of while loop :

while(condition)

{

//statements

}

like if, if condition in while block evaluates to true then statements will get executed. Along with that, there is always a statement that takes the control logic towards falseness of condition so that control logic can come out of loop.

3.) Basically there is no difference in functionality of for loop and while loop, Syntax of for loop:

for( initialization; condition; update)

{

//statements

}

In while loop, initialization is done before the starting of loop and update statement is inside the loop while in for loop all these things are at one place.

4.) If values passed in the function are defined locally and function is called using call by value then change in parameters wouldn't affect the original value and if function is called using call by reference then change in passed parameters would bring change to the original values as well.

5.) I am afraid I can't help you in that. For writing programs, you should visit Khan academy. It's a very good site to learn programming. I must encourage you to go there and get your basics right and get good marks in the quiz. Best of luck for your quiz.

Hope it helps.