• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 1 fuera de 3 páginas
Examen

ISTM 250 Exam 1 — Coding Practical Preparation

Document preview thumbnail
Vista previa 1 fuera de 3 páginas

ISTM 250 Exam 1 — Coding Practical Preparation. This document contains exam-style multiple choice questions with the correct answers clearly marked, covering the key topics tested in ISTM 250. Ideal for exam preparation, self-assessment and quick revision before your test.

Vista previa del contenido

ISTM 250 Exam 1 — Coding Practical Preparation
1. Create a Windows Forms order-total calculator that accepts quantity and unit price and displays the subtotal.

Requirements: Use a TextBox for quantity, a TextBox for unit price, a Calculate button, numeric validation, and a Label for output.
Reference solution:
private void btnCalculate_Click(object sender, EventArgs e)
{
if (!int.TryParse(txtQuantity.Text, out int quantity) || quantity < 1)
{
MessageBox.Show("Enter a quantity of at least 1.");
return;
}
if (!decimal.TryParse(txtUnitPrice.Text, out decimal price) || price < 0m)
{
MessageBox.Show("Enter a valid nonnegative unit price.");
return;
}
decimal subtotal = quantity * price;
lblSubtotal.Text = subtotal.ToString("C");
}

Rationale: The task assesses event handling, input validation, numeric data and output formatting.

2. Write a method that returns a shipping charge: $0 for orders of at least $75, otherwise $6.95.

Requirements: Create a decimal-returning method and call it from a button handler.
Reference solution:

private decimal CalculateShipping(decimal orderTotal)
{
if (orderTotal >= 75m)
return 0m;
return 6.95m;
}

Rationale: A focused method isolates business logic and the inclusive threshold is handled correctly.

3. Create a menu selection using switch that displays a message for options 1, 2, 3 and an invalid choice.

Requirements: Use an integer selection, a switch statement and a default branch.
Reference solution:

switch (choice)
{
case 1: lblMessage.Text = "New order"; break;
case 2: lblMessage.Text = "Search orders"; break;
case 3: lblMessage.Text = "Reports"; break;
default: lblMessage.Text = "Select 1, 2, or 3"; break;
}

Rationale: This assesses multiway selection and a safe fallback for unexpected input.

Información del documento

Subido en
18 de noviembre de 2026
Número de páginas
3
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$9.98

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
EmilyRhodes
4.4
(15)
Vendido
88
Seguidores
1
Artículos
10884
Última venta
1 día hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes