1. Given the following code... var speed = 30; var density = 50; var flow - 0; for(var i = 2; i <= 4; i++) { if( speed >= 11 ) { > density += 10; } else if( density < 51 || 1 == 3 ) { density += 1; } else { density = flow + speed; } speed- flow++; } a) What is the final value that is assigned to the 'speed' variable? b) What is the final value that is assigned to the 'density' variable? c) What is the final value that is assigned to the 'flow' variable? d) What is the final value that is assigned to the counter variable 'i'?
2. . var num1 = 40; var num2 = 90; var num3 = 20; var num4 = 130; var sum; for(var i = 1; i <= 2; i++) { if( num3 > num1 && num2 < num4 ) { num4 = num3; num1 = num1 + num4; sum = num1 - num2; } else if num4 < num1 || num2 != num3 ) { num1 = num4; num2 = num2 + num3; sum = num4 + num2; } else { num3 = num2; num4 = num3 - num4; sum = num4 + num1; } } What is the final value assigned to the sum variable?
1. Given the following code... var speed = 30; var density = 50; var flow - 0; for(var i = 2; i <= 4; i++) { if( speed >
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
1. Given the following code... var speed = 30; var density = 50; var flow - 0; for(var i = 2; i <= 4; i++) { if( speed >
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!