Explore BrainMass

Explore BrainMass

    C+ Programing Declaration

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    2. Given the following declaration and definition of a structure:

    struct computer {
    float cost;
    int year;
    int cpu_speed;
    char cpu_type[16];
    } model;

    Write a program to display the initial values held by the structure (you must use a structure) on the screen.

    3. When you enter the following data:

    Enter the year: 1996
    Enter the cost: $1234.56
    Enter the CPU type: Pentium
    Enter the CPU speed: 100MHz

    4. Your output will look like this:

    The type of the CPU inside your computer is: Pentium
    The speed (MHz) of the CPU is: 100
    The year that your computer was made: 1996
    You paid : $1234.56 for your computer

    © BrainMass Inc. brainmass.com March 4, 2021, 9:25 pm ad1c9bdddf

    Solution Summary

    The expert writes a program to display the initial values held by the structures on a screen using the C++ program.