
Quiz on String Conversion and Parsing
Authored by Audrey Fipps
Computers
9th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What method can be used to convert a string to a numeric data type?
You can directly cast from a string to a number
Parse()
Convert()
ToNumber()
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following code? string myString = "one"; int myInt = int.Parse(myString);
This code will cause an error in the program
The value in myInt will be 1
The value in myString will be 1
The value in myInt will be 0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which answer correctly describes a difference between Parse() and ToString()?
Parse() convert strings to numbers and ToString() converts numbers to strings.
Parse() only works on integers and ToString() only works on floating point data types
ToString() may throw an exception while Parse() will always work.
Parse() is best at converting small numbers and ToString() is best at converting large numbers.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following code? String data = "A"; char value = char.Parse(data);
The value variable will hold the A character
The value variable will hold an empty string
This code will cause a compile-time error
This code will cause a run-time StringFormat exception
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value is stored in myString when the following code is run? bool mystery = true; String text = mystery.ToString();
True
False
1
0
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value is stored in myString when the following code is run? double value = 0.10; string myString = value.ToString("P");
10.00 %
0.10
100
.001 %
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What value is stored in the result when the following code is run? String input = "3.14159"; int result = int.Parse(input);
An exception will be thrown at runtime
3.14159
3.14
PI
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
22 questions
Blown to Bits Chapter 2 Vocab
Quiz
•
9th - 12th Grade
16 questions
Subroutines
Quiz
•
9th - 11th Grade
20 questions
if statement java
Quiz
•
9th - 12th Grade
19 questions
Excel Review
Quiz
•
9th - 12th Grade
20 questions
quiz dasar python
Quiz
•
1st Grade - University
20 questions
looping and branching statements in C
Quiz
•
9th Grade
20 questions
Intro to Python Vocabulary
Quiz
•
7th - 12th Grade
20 questions
CM_Stop the Maddnes_Lap
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
8 questions
Spartan Way - Classroom Responsible
Quiz
•
9th - 12th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
3 questions
Integrity and Your Health
Lesson
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
9 questions
FOREST Perception
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
Discover more resources for Computers
10 questions
Navigating Digital Citizenship and Online Safety
Interactive video
•
6th - 10th Grade
20 questions
Computer / Internet Companies
Quiz
•
9th Grade
10 questions
Exploring the Basics of Google Sheets
Interactive video
•
9th Grade
10 questions
Exponent Rules
Quiz
•
9th - 12th Grade
20 questions
JavaScript - Karel
Quiz
•
9th - 10th Grade