Concept explainers
Consider the following C program
void fun (void) {
int a, b, c; /* defiinition.1 */
. . .
while (. . .)
int b, c, d; /* definition 2 */
. . . <---------------------- 1
while (…) {
int c, d, e; /* definition 3 */
. . . <------------------2
}
. . .<------------------3
}
. . . <------------------4
}
For each of the four marked points in this function, list each visible variable, along with the number of the definition statement that defines it.
Learn your wayIncludes step-by-step video
Chapter 5 Solutions
Concepts of Programming Languages (11th Edition)
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
C Programming Language
Starting out with Visual C# (4th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out with C++: Early Objects
- Fill in the blanks (...)C++ homework #include <iostream>using namespace std;class Date {public:….. void setDate(int date_day, int date_month, int date_year){ //put the date……………….} void getDate(){//show the date………}}; // end class //... int main(){int day,month,year; cout<<"Please enter the currents day, month and year"<<endl;cout <<"enter day: ";cin >> day;cout <<"enter month: ";cin >> month;cout <<"enter year: ";cin >> year; Date today; today.setDate(day,month,year);today.getDate(); Date yesterday;yesterday.setDate(day-1,month,year);cout<<"Yesterday ";yesterday.getDate(); return 0;}arrow_forwardC programming #include <stdio.h>int main() {int i, j, n ;printf("height? ") ;scanf("%2d", &n) ;for (i = 1 ; i <= n ; i++) {// printf("%d: ", i) ;for (j = 1 ; j <= i ; j++) {// Pick *one* of the following// printf("%d", j % 10) ;printf("*") ;}printf("\n") ;}return 0 ;} How can I get output like this by editing the given programming -- height? 5************************* and then how can I get the following?- height? 7 1 123 12345 1234567 123456789 12345678901 1234567890123arrow_forwardInput class ternary_operator { public static void main(String args[]) { int x = 3; int y = ~ x; int z; z = x > y ? x : y; System.out.print(z); } } Find outputarrow_forward
- mport java.util.Scanner; public class ParkingCharges { // function to calculate the basic charge using the asked hours static double getBasicCharge(int hours) { if (hours >= 7 && hours <= 8) return 5.50; else if (hours >= 5 && hours <= 6) return 4.50; else if (hours >= 2 && hours <= 4) return 4.00; return 3.00; } // function to return the amount to subtract based on local living and OAP static double getDiscount(String isLocal, String isOAP) { if (isOAP.equals("Yes") && isLocal.equals("Yes")) return 2.0 + 1.0; else if (isOAP.equals("Yes")) return 2.0; else if (isLocal.equals("Yes")) return 1.0; return 0; } public static void main(String[] args) { // create a new Scanner object Scanner sc = new Scanner(System.in); // prompt the user to ask if they are disabled…arrow_forward// Return remainder after integer division // Global variables int a = 4; int b = 30; int main() { // Use registers for local variables int remainder; int divisor; } if (a > b) { } else { } remainder = a; divisor = b; } remainder = b; divisor = a; while (remainder > divisor) { remainder -= divisor; return remainder;arrow_forwardSub: Data structure Consider the following 'C’ routine int DO ( int a[ ], int /b, int ub) { int temp; if( /b == ub) return a[lb]; else { temp =DO( a, Ib+1, ub); if (a[/b]<= temp); return a[/b]; else return temp; } What does DO(a,0,5) return if a[ ] = {0, –1,10,12,5,8};arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT