Problem Solving and Programming Assignment, UM, Malaysia Write a C++ program that obtains the following values from the user: An integer number A floating point number A string value
University | University of Malaysia (UM) |
Subject | Problem Solving and Programming |
Questions
- Write a C++ program that obtains the following values from the user:
a. An integer number
b. A floating point number
c. A string value
The program should display the values entered using the following formats:
a) The integer number should be displayed as a decimal, hexadecimal, and octal value, left-justified within the field, the width of which is 6;
b) The floating point number should be displayed with a +/- sign and four digits after the decimal points using the fixed decimal point and scientific notation.
c) The string should be displayed right justified in a field, the width of which is 25; unused spaces within the field should be filled with a • character. - Write a C++ program that uses manipulator setw() to print the diamond shape as follows:
- Write a C++ program that reads a floating point number (of type double) to represent a radius for a circle. Calculate the circumference (C) of the circle using the formula C = 2πr, where PI(π) is defined as 3.14159. Use preprocessor directives # to define the PI value. Display the result in two decimal places.
- Write a C++ program that reads a floating-point number (of type double) from the user. The program then separates the number into its integral part and fractional part. For example, if the input is 123.456789:
- Write a C++ program that reads a character (A-Z, a-z) from the user and produces a decimal value for it. Use static cast in your program. Sample output is shown below:
Get Help By Expert
Assignmenthelper.my is the online platform of choice for any students looking to ace their online exams. We understand that online learning and assessments can often be a challenge, so our team of experts and tutors provide reliable online exam help to make sure you get the grades you desire. With assignment help Malaysia, we provide professional assistance for students of all levels.
Recent Solved Questions
- PRG2104: The aim of this project is to achieve the learning outcomes: Computer Science Assignment, SU, Malaysia
- Unit 1 Briefly introduce the organization you are working in or have previously worked in, by highlighting the different stakeholders: Strategic Management And Leadership, Assignment, Malaysia
- MGT4231E: Intercultural Management Assignment, IIU, Malaysia The key to a successful organization is to have a culture based on a strongly held and widely shared set of beliefs
- ABCM2103: Discuss the following topic(s) in the forum and submit proof of your participation in the online discussions: INFORMATION TECHNOLOGY, MEDIA AND SOCIETY Assignment, OUM, Malaysia
- Marketing Analysis Case Study, TU, Malaysia At its founding in 1906, Planters Peanut Company sold one nut type. Historically, peanuts were viewed as food
- Bachelor of Economics Assignment, HU, Malaysia Students are required to look through the given articles in HLMS and choose one of the topics which they are comfortable
- AMCA5203: Basic statistics and research method Assignment, OUM, Malaysia The Assignment Is Intended To Provide Learners With The Opportunity To Grasp The Understanding Of Basic Concepts Of Statistics
- MGF1010: Introduction to Management Assignment, MU, Malaysia Choose an organisation which you would like to render support in promoting workplace well-being
- HPGD2103 Guidance and Counselling / Bimbingan dan Kaunseling September 2025 Semester
- Basic Agriculture Economic Assignment, SU, Malaysia