Question

using C (not C++) in visual studios 2015 write a program that Defines new data type...

using C (not C++) in visual studios 2015 write a program that Defines new data type “Account” & data members are id_no, balance, and rate. Your program should obtain Account information from the user. Create an Account object, initialize the object and calculate the interest on the account.

Output:

Enter account id:122655

Enter balance: 3000

Enter intrest rate: 0.1

The intrest on the account #122655 is $300.00

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

struct account {
   int id;
   int bal;
   float itrate;
};

int main(void) {
   struct account inp;
   printf("Enter Account number:");
   scanf("%d",&inp.id);
   printf("\nEnter balance:");
   scanf("%d",&inp.bal);
   printf("\nEnter interest rate:");
   scanf("%f",&inp.itrate);
   float interest = inp.bal*inp.itrate;
   printf("\nInterest on account #%d is $%f",inp.id,interest);
   return 0;
}

Works for current example

Add a comment
Know the answer?
Add Answer to:
using C (not C++) in visual studios 2015 write a program that Defines new data type...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program using C in Microsoft visual studios. Write a function that receives an array...

    Write a program using C in Microsoft visual studios. Write a function that receives an array of integers and the array length and prints one integer per line (Hint: Use \n for a line break). Left align all of the integers and use a field width of 10. Populate an array of 10 elements from the user and pass the array and its length to the function.

  • C++ Visual Studios - Program - Vector - Simple Create a program that utilizes VECTOR for...

    C++ Visual Studios - Program - Vector - Simple Create a program that utilizes VECTOR for the following topic. Topic: Carl's Cab Stand needs a program to keep track of their daily clients. Your program shall allow the user to enter 10 names. You will then retrieve the names, one by one, from the data structure (using the appropriate method of retrieval for each data structure) and present them on-screen so that Carl knows who to service next. Include a...

  • Write a program to test the breadth-first topological ordering algorithm. Data Structures, Visual Studios 2017 C++

    Write a program to test the breadth-first topological ordering algorithm. Data Structures, Visual Studios 2017 C++

  • C++ program Create a class Time having data members HH, MM, SS of type integer. Write...

    C++ program Create a class Time having data members HH, MM, SS of type integer. Write a C++ program to do the following: 1. Use a Constructor to initialize HH, MM, SS to 0. 2. Create two Objects of this class and read the values of HH, MM, SS from the user for both objects (Using proper member functions). 3. Use a binary + operator to add these two objects created (Store & display result using separate object). 4. Use...

  • Can someone help me with this problem. We're using microsoft visual studios and its from my...

    Can someone help me with this problem. We're using microsoft visual studios and its from my assembly code language class. we're using this template in class from the lecture slides Write a program and verify it using visual studio that does the following: Use type, lengthof, and size to make your program more independent of the data type. 3) Write a program that first reads the message entered by the user and stores it in Myname. Then it prints the...

  • C++ Visual Studios Program - Simple The program must use a Vector. Topic: Carl's Cab Stand...

    C++ Visual Studios Program - Simple The program must use a Vector. Topic: Carl's Cab Stand needs a program to keep track of their daily clients. Your program shall allow the user to enter 10 names. You will then retrieve the names, one by one, from the data structure (using the appropriate method of retrieval for each data structure) and present them on-screen so that Carl knows who to service next. Include a printed line at the end of the...

  • In this assignment, you are to write a C++ program (using Visual C++ 2015) that reads...

    In this assignment, you are to write a C++ program (using Visual C++ 2015) that reads training data in WEKA arff format and generates ID3 decision tree in a format similar to that of the tree generated by Weka ID3. Please note the following: Your algorithm will use the entire data set to generate the tree. You may assume that the attributes (a) are of nominal type (i.e., no numeric data), and (b) have no missing values. In general, the...

  • Include the blackbox output done with C# microsoft visual studios software. write a C# program to...

    Include the blackbox output done with C# microsoft visual studios software. write a C# program to sort a parallel array that consists of customer names and customer phone numbers. The solution should be in ascending order of customer names. For instance, if the input is string[] custNames- { "ccc", "ddd", "aaa", "bbb" }; stringl] custIds687-3333", "456-4444", "789-1111", "234-2222" ; then, the solution is string[] string[] custNames- { "aaa", "bbb", "ccc", "ddd" }; custIds"789-1111", "234-2222", "687-3333", "456-4444"]; There are some restrictions:...

  • Write a C Program 2. Write a program which defines a (hollow rectangular) prism as a...

    Write a C Program 2. Write a program which defines a (hollow rectangular) prism as a structure consisting of: length(int) width(int) height(int) • weight(double) • contents(char [25]) Initialize the structure with default values 10, 6, 3, 4.5, and "Best Jewelry" Ask user for new length, width and height and then display Contents, volume, and sum of dimensions

  • C# Visual Studios HelloWorld For this assignment, you'll work with first creating an array and populating...

    C# Visual Studios HelloWorld For this assignment, you'll work with first creating an array and populating it's values. Then, we'll use the values in the array to calculate the average. Since it's common for an average to result in numbers with decimal points, the array you create should be of type double[]. This program will need to use dynamic input from the user so perform the following steps: Ask the user how many numbers need to be added. Use this...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT