
Quiz on String Conversion and Parsing

Quiz
•
Computers
•
9th Grade
•
Hard
Audrey Fipps
Used 3+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
quiz dasar python

Quiz
•
1st Grade - University
20 questions
Python variables and operators quiz

Quiz
•
9th - 12th Grade
20 questions
Python Basics 2

Quiz
•
9th - 12th Grade
20 questions
CodeHS - Intro to Python - Basics and Console Interaction

Quiz
•
9th Grade - Professio...
16 questions
XIБ_Script

Quiz
•
9th - 12th Grade
15 questions
Programación con Java

Quiz
•
9th - 11th Grade
18 questions
Scanner & If Statements

Quiz
•
5th - 12th Grade
16 questions
Sains Komputer Tingkatan 4 - 1.6.3 Membezakan antara

Quiz
•
1st Grade - Professio...
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade