Docsity

JMP Scripting Practice Exam: JMP 15, Exams of Technology

Toggle sidebar
bg1
A00 908 JMP Scripting using JMP 15 Practice Exam
**Question 1.** Which JSL command opens an existing data table named
“sales.jmp”?
A) Open Table("sales.jmp")
B) Data Table Open("sales.jmp")
C) Open("sales.jmp")
D) New Table("sales.jmp")
Answer: A
Explanation: The Open Table() function loads a JMP data table file; the file name is
supplied as a string argument.
**Question 2.** In JSL, what is the purpose of the double slash “//” at the
beginning of a line?
A) It starts a new script block.
B) It denotes a comment.
C) It creates a division operation.
D) It signals the end of a function.
Answer: B
Explanation: “//” introduces a single‑line comment, which is ignored by the
interpreter and improves script readability.
**Question 3.** Which of the following data types can a JSL column hold?
A) Numeric only
B) Character only
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download JMP Scripting Practice Exam: JMP 15 and more Exams Technology in PDF only on Docsity!

Question 1. Which JSL command opens an existing data table named “sales.jmp”? A) Open Table("sales.jmp") B) Data Table Open("sales.jmp") C) Open("sales.jmp") D) New Table("sales.jmp") Answer: A Explanation: The Open Table() function loads a JMP data table file; the file name is supplied as a string argument. Question 2. In JSL, what is the purpose of the double slash “//” at the beginning of a line? A) It starts a new script block. B) It denotes a comment. C) It creates a division operation. D) It signals the end of a function. Answer: B Explanation: “//” introduces a single‑line comment, which is ignored by the interpreter and improves script readability. Question 3. Which of the following data types can a JSL column hold? A) Numeric only B) Character only

C) Numeric, Character, Date, Time, and Logical D) List only Answer: C Explanation: JMP columns can store numeric, character (string), date, time, and logical (boolean) values. Question 4. To create a global variable named “threshold” with value 0.05, which syntax is correct? A) Local threshold = 0.05; B) Global threshold = 0.05; C) threshold << 0.05; D) Set Variable("threshold",0.05); Answer: C Explanation: The “<<” operator assigns a value to a global (script‑level) variable, making it accessible throughout the session. Question 5. Which JSL construct repeats a block of code while a condition remains true? A) For B) While C) Loop D) Repeat Answer: B

Question 8. How would you rename column “OldName” to “NewName” in a script? A) Rename Column("OldName","NewName"); B) Column("OldName") << Set Name("NewName"); C) Set Column Name("OldName","NewName"); D) Column Rename("OldName","NewName"); Answer: B Explanation: The Set Name() message applied to a column object changes its name. Question 9. Which JSL function creates a new empty list? A) List() B) New List() C) {} D) List Create() Answer: A Explanation: Calling List() without arguments returns an empty JSL list. Question 10. To write a numeric matrix “m” to a CSV file called “output.csv”, which command is appropriate? A) Write CSV(m,"output.csv"); B) Export(m,"output.csv");

C) Save As(m,"output.csv"); D) Write(m,"output.csv"); Answer: B Explanation: The Export function writes tables, matrices, or lists to external files such as CSV. Question 11. Which JSL statement correctly defines a custom function that returns the square of a number? A) Function Square(x){ Return xx; } B) Square(x) = xx; C) Square = Function( {x}, xx ); D) Square(x){ Return(xx); } Answer: A Explanation: The Function keyword (or a script block) defines a reusable routine; the syntax shown declares a function named Square. Question 12. When using a For Each loop over a list “myList”, which variable automatically represents each element? A) i B) element C) _ D) The name you give after the “in” keyword Answer: D

Question 15. In JSL, how would you suppress the display of a platform’s output window? A) Set Show Output(0); B) Platform("Fit Y by X") << Hide(); C) Set Show Window(0); D) Use the “No Show” flag in the message call Answer: D Explanation: Adding the “No Show” option (e.g., Fit Y By X( X, Y, No Show ) ) prevents the platform window from appearing. Question 16. Which JSL command returns the number of rows in the current data table? A) N Row() B) Row Count() C) N Rows() D) Rows() Answer: A Explanation: The function N Row() returns the total row count of the table on which it is called. Question 17. How can you add a new column named “Profit” that calculates Revenue – Cost for each row? A) New Column("Profit", Formula( Revenue - Cost ));

B) Column("Profit") << Set Formula( Revenue - Cost ); C) dt << New Column( "Profit", Numeric, Formula( :Revenue - :Cost ) ); D) Add Column("Profit", Revenue - Cost); Answer: C Explanation: The New Column message applied to a data table object creates a column; the “Numeric” type and a Formula expression are supplied. Question 18. Which JSL function extracts the first element of a list named “myList”? A) First(myList) B) myList[1] C) myList[0] D) List First(myList) Answer: B Explanation: List indexing in JSL is 1‑based, so myList[1] returns the first element. Question 19. To merge two tables “t1” and “t2” on a common column “ID”, which command is appropriate? A) Join(t1,t2,By("ID")); B) t1 << Merge(t2, By("ID")); C) Merge Tables(t1,t2,Key("ID")); D) t1 << Join(t2, ID);

Explanation: The If function evaluates the condition; because – 3 > 0 is false, it returns the third argument, “Non‑positive”. Question 22. Which of the following is the correct way to read a CSV file named “data.csv” into a new data table? A) dt = Open CSV("data.csv"); B) dt = Open("data.csv"); C) dt = Read CSV("data.csv"); D) dt = Open Table("data.csv"); Answer: B Explanation: Open() automatically detects the file type; when given a .csv extension it imports the file as a data table. Question 23. In JSL, which command clears all variables from the global environment? A) Clear All(); B) Reset(); C) Delete All Variables(); D) Clear Globals(); Answer: A Explanation: Clear All() removes all user‑defined global variables, leaving only built‑in objects.

Question 24. Which message would you send to a Display Box object to change its displayed text to “Analysis Complete”? A) Set Text("Analysis Complete"); B) Set Label("Analysis Complete"); C) Set Value("Analysis Complete"); D) Set Text Box("Analysis Complete"); Answer: A Explanation: Display Box objects respond to the Set Text() message to modify the string they show. Question 25. What is the effect of the JSL line “dt << Delete Rows( Where( :Score < 50 ) );”? A) Removes rows where the Score column is less than 50 B) Deletes the Score column C) Sets Score values < 50 to missing D) Filters the table to keep only rows with Score < 50 Answer: A Explanation: Delete Rows with a Where clause eliminates rows meeting the logical condition. Question 26. Which JSL function returns the current working directory as a string? A) Get Directory()

Answer: B Explanation: Insert Rows with the position End and a list of values adds a single row at the bottom. Question 29. Which of the following options correctly suppresses warning messages during script execution? A) Set Warning(0); B) Suppress("Warnings"); C) Set Show Warning(0); D) Set Message(Warning,0); Answer: A Explanation: Set Warning(0) disables the display of warning dialogs while the script runs. Question 30. In JSL, how can you retrieve the value from column “Age” in the current row inside a formula? A) Age B) :Age C) Column("Age") D) Get Value("Age") Answer: B Explanation: Within a column formula, the colon prefix (e.g., :Age) references the column’s value for the row being evaluated.

Question 31. Which message would you use to programmatically click a button box named “RunBtn” in a dialog? A) RunBtn << Click(); B) RunBtn << Press(); C) RunBtn << Activate(); D) RunBtn << Trigger(); Answer: A Explanation: The Click() message simulates a user click on a button box object. Question 32. To export a data table “dt” to an Excel workbook named “report.xlsx” with the sheet name “Summary”, which command is appropriate? A) dt << Export Excel("report.xlsx", Sheet("Summary")); B) dt << Save As("report.xlsx", Excel, Sheet("Summary")); C) Export(dt, "report.xlsx", Sheet="Summary"); D) dt << Save Workbook("report.xlsx", Sheet="Summary"); Answer: A Explanation: The Export Excel message allows specification of the file name and target sheet. Question 33. Which JSL function creates a list containing the numbers 1 through 5 without manually typing each element? A) List(1:5)

Answer: B Explanation: Sending the Fit Model message to a data table returns a model object that can be stored in a variable. Question 36. In JSL, how would you test whether a variable “x” is missing (i.e., contains a missing value)? A) Is Missing(x) B) Is Null(x) C) Is NA(x) D) Missing(x) Answer: A Explanation: The Is Missing() function returns true if the argument is a missing numeric or character value. Question 37. Which JSL command creates a simple modal dialog with an OK button and the message “Processing completed”? A) Dialog("Processing completed") << Add Button("OK"); B) New Window("Processing completed", Modal, OK); C) Message Box("Processing completed"); D) dt << Show Message("Processing completed"); Answer: A Explanation: The Dialog object can be built with a message and a button; Add Button adds the OK control.

Question 38. To concatenate two tables “tA” and “tB” vertically (stack rows), which command is correct? A) tA << Stack(tB); B) tA << Append Table(tB); C) tA << Concatenate(tB); D) tA << Join(tB, Mode("Vertical")); Answer: A Explanation: The Stack message adds the rows of the second table beneath the first, preserving column alignment. Question 39. Which JSL function returns the maximum value found in a numeric column “Score”? A) Col Max(:Score); B) Max Column(:Score); C) Max(:Score); D) Col Max(Column("Score")); Answer: D Explanation: The Col Max function operates on a column object; Column("Score") retrieves that column. Question 40. Which option correctly sets the modeling type of column “Outcome” to “Nominal”?

D) Echo("Hello, JMP!"); Answer: A Explanation: Print sends text to the Log, which is useful for debugging or informative messages. Question 43. To create a checkbox in a dialog that stores its state in variable “useLog”, which syntax is required? A) dlg << Add Check Box("useLog"); B) dlg << Add Check Box("Use Log", useLog); C) dlg << Add Check Box("Use Log", Variable("useLog")); D) dlg << Add Check Box("Use Log", useLog); Answer: D Explanation: The Add Check Box message takes the label and the variable name that will hold the Boolean result. Question 44. Which of the following statements correctly deletes column “Temp” from data table “dt”? A) dt << Delete Column("Temp"); B) dt << Remove Column("Temp"); C) dt << Delete Columns( :Temp ); D) dt << Delete Columns( Column("Temp") ); Answer: D

Explanation: Delete Columns expects a column object; Column("Temp") returns that object for deletion. Question 45. What does the JSL command “dt << Set Property( “Title”, “Sales Data” );” accomplish? A) Renames the data table file on disk B) Changes the window title displayed for the table C) Sets a custom property that can be retrieved later D) Alters the column header of the first column Answer: C Explanation: Set Property adds a user‑defined key/value pair to the table’s metadata. Question 46. Which JSL function returns a random integer between 1 and 10 inclusive? A) Rand Integer(1,10) B) Random Integer(1,10) C) Random(1,10) D) Rand(1,10) Answer: B Explanation: Random Integer(min,max) generates a uniformly distributed integer within the specified range.