Accenture Software Engineering Practice Question
"Invalid balloon number " O5R nu2mber2 > 14 OR 8number < 50 "This balloon can fiy to Tweety" OR number < 1 PRINT AND number%7 == 0 number%3 == 0 number > 50 ELSE "This balloon cannot fiy to Tweety" OR number%7 == 0 END IF You are provided with a partial pseudocode for the below problem statement. Drag and Drop the options provided so that it will be the correct pseudocode. Save Tweety Silvester and Tweety are friends. Bender was one of the Silvester's enemy. One day Silvester and Tweety went on to a trip. Bender planned to kidnap Tweety.. He kidnapped and kept her in one of the hot balloons tied up to a height. There were 50 hot balloons numbered from one. Each balloon will fiy to a certain height. Only the numbers having both 3 and 7 as its factors can fiy upto the height of the Tweety's balloon. Silvester was confused and he didn't know which numbered balloon can fiy to Tweety. (Note: If balloon number is greater than 50, or balloon number less than 1, then it should display invalid balloon number) Eg: Balloon's number: 42 This balloon can fiy to Tweety. Eg: Enter the Balloon's number: 24 This balloon cannot fiy to Tweety. Pseudocode : BEGIN DECLARE variable number READ number IF number > 50 OR number < 1 THEN PRINT "Invalid balloon number " ELSE IF number%3 == 0 AND number%7 == 0 THEN PRINT "This balloon can fiy to Tweety" ELSE PRINT "This balloon cannot fiy to Tweety" END IF ENDAnswer options
A
Save Tweety Silvester and Tweety are friends. Bender was one of the Silvester's enemy. One day Silvester and Tweety went on to a trip. Bender planned to kidnap Tweety.. He kidnapped and kept her in one of the hot balloons tied up to a height. There were 50 hot balloons numbered from on
B
Each balloon will fiy to a certain height. Only the numbers having both 3 and 7 as its factors can fiy upto the height of the Tweety's balloon. Silvester was confused and he didn't know which numbered balloon can fiy to Tweety. (Note: If balloon number is greater than 50, or balloon number less than 1, then it should display invalid balloon number) Eg: Balloon's number: 42 This balloon can fiy to Tweety. Eg: Enter the Balloon's number: 24 This balloon cannot fiy to Tweety. Pseudocode : BEGIN DECLARE variable number READ number IF number > 50 OR number < 1 THEN PRINT "Invalid balloon number " ELSE IF number%3 == 0 AND number%7 == 0 THEN PRINT "This balloon can fiy to Tweety" ELSE PRINT "This balloon cannot fiy to Tweety" END IF END
Correct answer: Save Tweety Silvester and Tweety are friends. Bender was one of the Silvester's enemy. One day Silvester and Tweety went on to a trip. Bender planned to kidnap Tweety.. He kidnapped and kept her in one of the hot balloons tied up to a height. There were 50 hot balloons numbered from on
Explanation
Correct answer: Save Tweety Silvester and Tweety are friends. Bender was one of the Silvester's enemy. One day Silvester and Tweety went on to a trip. Bender planned to kidnap Tweety.. He kidnapped and kept her in one of the hot balloons tied up to a height. There were 50 hot balloons numbered from on.