Question
Asked Nov 11, 2019
1 views

Write a wholly creative quiz program that consists of three original questions that you make up according to these specifications:

One question should require user input of type int
One question should require user input of type float
One should require a string input

check_circle

Expert Answer

Step 1

As here, no programming language is specified. So, we are providing the solution in java.

The below given java program will obey the following rubrics:

  • Importing essential header files.
  • Displaying message to user to enter height (taken in the float data type).
  • Taking input of height from user.
  • Displaying message to user to enter age (taken in the int data type).
  • Taking input of age from user.
  • Displaying message to user to enter name (taken in the string data type).
  • Taking input of name from user.
  • Then if the user entered values of height and age are equal to zero, then displaying message to user to enter valid details.
  • Else displaying all the user entered data to user.
Step 2

Program code:

 

//importing essential header files

import java.util.Scanner;

//main class

public class QuizProgram {

    //main method

    public static void main(String[] args) {

        //instantiating scanner class

        Scanner scFloat = new Scanner(System.in);

        //displaying question to user

        System.out.println("Question 1: Enter your height in feet: ");

        //taking input data from user

        float height = scFloat.nextFloat();

        //instantiating scanner class

        Scanner scInt = new Scanner(System.in);

        //displaying question to user

        System.out.println("Question 2: Enter your age: ");

        //taking input data from user

        int age = scInt.nextInt();

        //instantiating scanner class

        Scanner scString = new Scanner(System.in);

        //displaying question to user

        System.out.println("Question 3: Enter your name: ");

&n...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: I am getting a floating point exception in my code. Which is to divide matrix 1 by matrix 2 (striaig...

A: Program Instructions:A floating-point exception occurs when an attempt is made to divide a number by...

question_answer

Q: What folder contains group policy templates, logon/logoff scripts, and DFS synchronization data? Gro...

A: “System Volume (SYSVOL)” folder contains group policy templates, logon scripts, and Distributed File...

question_answer

Q: What is the new risk management framework initiative? How is it superior to the previous approach fo...

A: The New risk management framework initiative:It is the NIST special publication 800-37, this is the ...

question_answer

Q: Create a new file (in Dev C++) and save it as lab11_XYZ.cpp (replace XYZ with your initials). Create...

A: This C++ program contains header file swap_XYZ.h and cpp file lab11_XYZ.cppswap functions for int, c...

question_answer

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: Program:  import java.util.Scanner; public class AtmSimDoLoop{public static void main(String[] args)...

question_answer

Q: In Python Use the Design Recipe to write a function bools_2_str, which consumes a list of booleans a...

A: Create a Boolean list with true and false value such as:boolList = [True, True, False, True, False, ...

question_answer

Q: Using MIPS assembly language can someone help me write a program that does .. Write a program to fin...

A: Program Instructions:Ask the user for number of integers and get those integers.Load the array, redu...

question_answer

Q: How an executable infecting computer virus might append itself to an executable. What changes must i...

A: The VIRUS stands for vital information Resource under siege.The virus may be loaded into your comput...

question_answer

Q: Let F = (V; A) be a digraph. Show that if u is k-edge-connected to v and v is k-edge-connected to w,...

A: Connectivity:To measure the connectedness of a digraph ‘F’, consider the minimum number of vertices ...