Microsoft Visual C#
Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 3E

Choose the best data type for each of the following, so that no memory storage is wasted. Give an example of a typical value that would be held by the variable, and explain why you chose the type you did.

  1. the number of years of school you have completed
  2. your final grade in this class
  3. the population of China
  4. the number of passengers on an airline flight
  5. one player’s score in a Scrabble game
  6. the number of Electoral College votes received by a U.S. presidential candidate
  7. the number of days with below freezing temperatures in a winter in Miami, Florida
  8. one team’s score in a Major League Baseball game

Blurred answer
Students have asked these similar questions
i. Explain the following datatypes in your own words without copying it from anywhere. a. int b. float. c. double. d. string. e. Bool. ii. Write a program in C++ with the following datatypes. Use the 3 different variables with the same data type. Explain the codes step by step. a. int b. float. c. double. d. string. e. bool.
Calculate and return the sum of two decimal numbers - getSum. Given the radius of a circle, print the area of a circle - printArea. Given a student’s name and three test scores (of type int), print the student’s name and average test score - printStudentDetails.  Compute and return the average speed of a car, given the distance traveled (as type double) and traveling time (in hours and minutes, both of type int) - getAverageSpeed. *
Here is the question: The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. Here is the code given: // Program displays some facts about a string public classDebugSeven3 {    public static void main(String[] args)    {        String quote =          "Honesty is the first chapter in the book of wisdom. - Thomas Jefferson";       System.out.println("index.of('f') is: " + quoteindexOf('f'));       System.out.println("index.of('x') is: " + quoteindexOf('x'));       System.out.println("char.At(5) is: " + quote.charAt(50));       System.out.println("endsWith(\"daughter\") is: " + quote.endsWith("daughter"));       System.out.println("endsWith(\"son\") is: " + quote.endsWith("son"));       System.out.println("replace('e', '*') is: ", quote.replace('e', '*'));    } }

Chapter 2 Solutions

Microsoft Visual C#

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Computer Programming for Beginners | Functions, Parameters & Arguments | Ep24; Author: Programming With Avelx;https://www.youtube.com/watch?v=VXlh-qJpfw0;License: Standard YouTube License, CC-BY