Create a C program. Given that 1 Jan 2021 is a Friday, write a program that asks for a user input of the month number (1-12 for Jan-Dec, respectively) and prints the week day of 1st day of the corresponding month. You may assume the no. of days į n each month e.g.: "Thirty days hath September, April, June and November. All the rest have thirty-one, Except February, which has only twenty-eight, in one year in four, add one day more." Sample code: int daysOfMonth(int mm){ switch(mm){ case 9: case 4: case 6: case 11: www wwww return(30); case 2: ww n return(28); default: return(31); } Sample output: Enter a month number (1-12): 5 1 May 2021 is Saturday
Q: Write a C++ program that reads student scores, determines the best score, and assigns grades using…
A: ALGORITHM:- 1. Take input for the number of student marks. 2. Create a marks array of that size. 3.…
Q: 8. Write a C program that takes the user to provide a single character from the alphabet. Print…
A: According to our guidelines, we are allowed to solve only the first question. Please post the other…
Q: Write a C program that will ask the user to enter the lengths of a femur bone and a humerus bone…
A: Required:
Q: Write a C++ program to find the sum of the series given below: 12 + 22 + 32 + ........... + n2…
A: Write a C++ program to take input value of n and print the sum of the series 12 + 22 + 32 + …… +…
Q: Write a complete C program to prompt the user to enter the total chargeable income (RM), and then…
A: given: required: to create a c program to calculate income tax based on the given table
Q: Write a C++ program that takes a 4-digit number from user as and input and displays all the…
A: The combination is the permutation of numbers. Read the 4-digit number from the user then convert it…
Q: Write a C++ program that reads in temperature in Celsius and displays temperature in Fahrenheit;…
A: Note- Your output is wrong f=(9/5)*20+32 = 68 is the correct answer and you are showing 55 which is…
Q: 21. Write a C++ program in which the user enters the height in the format feet.inch and the program…
A: Write a C++ program in which the user enters the height in the format feet.inch and the program…
Q: Write a C++program (using cout and cin) that calculates a student's GPA. Ask the user to enter grade…
A: CODE:- #include<iostream>#include<conio.h> using namespace std;int main(){ char…
Q: Write a C++ program that (1) asks the user to input a year number expressed in the Roman notation,…
A: The complete C++ code is given below with code and output screenshots Comments has been added to…
Q: Here are my Instructions for my C++ Program Exercise Write a program that accepts as input: 1. The…
A: The below C++ program will obey the following rubrics: Including necessary header files. Declaring…
Q: Write a program that convert integer Fahrenheit temperature to Celsius or Celsius to Fahrenheit.…
A: First, we will input either CF or FC. If FC is entered, then we will convert the entered temperature…
Q: Write a C++ program that asks the user to input a positive integer representing the elapsed number…
A: program in c++ user has to input the number of elapsed seconds
Q: Write a C++ program that reads user's choice as single character then do the following: • If the…
A: Use switch case for choice.
Q: Write a C++ program that continues reading an instructor marks until he inputs 999. Your program…
A: Algorithm: Start Read marks in a vector Initialize first element of vector as max and min Iterate…
Q: Write a C++ program that allows the user to input a temperature value in Celsius and prints the…
A: Note: Comments have been added in the source code itself to have a better understanding of the code.…
Q: Write a C program that reads in the mass of two bodies and the distance between them and then…
A: Using const keyword, we can declare a constant. Here we are dealing with decimal values and as…
Q: Write a C++ program that asks the user to input a positive integer representing the elapsed number…
A: (1)Read the seconds (2)Compute the number of hours ,min and sec (3)Display the result
Q: Create a C program. Given that 1 Jan 2021 is a Friday, write a program that asks for a user input of…
A: Given that 1 Jan 2021 is a Friday. The task is to print the calendar for the month which user ask…
Q: 2/ Write a C++ program to read an integer number and a temperature, then apply the rules of…
A: The required code is as follows:-
Q: Q.4 Write a C program to print all the prime factors of a given number with its frequency. For…
A: We need to find the prime factorization of 24 which is 2 * 2 * 2 * 3. Output will 2 3 3 1 In the…
Q: Write a C program hoursToDays.c that will convert a number of hours to days and hours the time is…
A: As per the requirement program is developed. Algorithm: Step 1: Write the main method Step 2: Define…
Q: Write a C++ program that reads user's choice as single character then do the following: • If the…
A: In C++, long int can store integer between -2,147,483,648 to 2,147,483,647.
Q: Write an algorithm, draw a flowchart, and write a C program that calculates a customer water bill.…
A: #Algorithm for calculating the customer water bill. STEPS:- 1)Start. 2)Define the minimum pay value.…
Q: Q2\\ Write a C++ program to read 10 numbers then find the square of a number, ?if it is even
A: #include <iostream>using namespace std;int main(){ // Declare array of numbers, square to…
Q: Write a C++ Program that calculate and print the insurance for 15 cars. For each car, the program…
A: #include <iostream>using namespace std; int main(){ int year, price; char insuranceType;…
Q: Create a c++ program that askt 4 numbers (a,b,c,d) and arrange it in ascending order using if-else
A: C++ Program: #include <iostream>using namespace std; int main(){ int a, b, c, d, tmp;…
Q: The result of num1 + num2 (if num1 is equal to num2) The result of num1 – num2 (if num1 is greater…
A: Please find the answer below :
Q: Create a program in C++ that accepts sales for the week ( Monday - Friday ) and display the highest…
A: C++ Program: #include <iostream>using namespace std; // function for lowest Salesfloat…
Q: Write a C++ program to calculate the charges of a phone call. The call rate is as follows: Call…
A: - We need to code the charges program in C++.
Q: Write a C++ program that accepts an amount of money on deposit and a number of years it has been on…
A: #include<iostream> using namespace std; int main(){ float amount,interst,years;…
Q: Q 2 : Write a C++ program which inputs a number from the user, and classify it as even or odd. For…
A: Given: Q 2 : Write a C++ program which inputs a number from the user, and classify it as even or…
Q: Q.1/Write a C++ program that print the symbol shown in column two with any number that the user…
A:
Q: For this question: Write a C program that determines the day number (1 to 366) in a year for a date…
A: #include <stdio.h>int leap (int );int mon_cnt (int );int day_count (int,int,int);int res;int…
Q: Write a C program to input electricity unit charges and calculate total electricity bill according…
A: Answer :
Q: Write a C++ program that reads a five-digit integer value representing MINUTES. The program should…
A: Note : Since there are multiple questions, according to the guidelines I have done the first…
Q: Write a C++program that reads user's choice as single character then do the following: • If the user…
A: The program has been implemented using switch case. The choice entered by user has been switched.…
Q: Write a C++ program (using cout and cin) that calculates a student's GPA. Ask the user to enter…
A: PROGRAM CODE: #include <iostream> // include header file for input output stream…
Q: Write a C++ program that prompts the user to input three (3) integers: MM, DD, and YYYY. For…
A: PROGRAM EXPLANATION: Include the header file. Define a function to find the leap year. The logic…
Q: rite a C++ program that inputs one six-digit number, separates the number into its individual digits…
A: Required program needs to input any six digit number and using integer division and the remainder…
Q: April Write a C++ program that will prompt the user to enter a year and produce a calendar for that…
A: Here is the code of your question in C++ with an output.
Q: Write a complete C++ program to do the following: Prompt the user to enter the number of students…
A: Required: Prompt the user to enter the number of students and store it into a variable called…
Q: Write a C-program that converts metric measurements to imperial system values. Measurements are…
A: Given conversion rules to use: 1 meter = 3.2808 feet; 1 gram = 0.002205 pounds; temperature in…
Q: Write a complete C++ program to have a user enter a temperature and then determine If water would…
A: check three conditions: - if userInput >212 display “greater than boiling point” else if…
Q: Write a program in c++ to read the radian of a circle, check if it is bigger than zero, and if it is…
A: ask the user to give the radius of the circle as input pass the radius as to the function called…
Q: Write a C# program that asks the user for a starting value, and ending value, and an increment. Your…
A: The numbers can be displayed with 3 points by using {0:3f} Using for loop, from start, print the…
Q: Write a C++ program to take integers as input from user until the sum of all those numbers becomes…
A: #include<iostream>using namespace std; int main(){ int sum=0; int number; int count =0;…
Q: 2. Write a C program that creates a table of degrees Celcius with the corresponding degrees…
A: Algorithm: Step1: Declare variable, farhenVal to store calculated value. Step2: Display the Table…
Q: Write a C++ program that takes a 4-digit number from user as and input and displays all the…
A: #include<stdio.h>int main(){int i,j,k,l,m,n; printf("Enter the digit number : "); scanf("%d",…
Q: Write a C++ program that reads student scores, determines the best score, and assigns grades using…
A: #include <iostream> using namespace std; char getGrade(int score, int best){ char…
C PROGRAM
Step by step
Solved in 2 steps with 1 images
- (Practice) Write a C++ program that accepts the rectangular coordinates of two points (x1,y1)and(x2,y2), calculates the distance of each point from the origin, and calculates the distance between the two points. The distance, d, between two points is given by this formula: d=(x2x1)2+(y2y1)2Write a C program that reads the income of a person and calculates his total tax according tothe following conditions: if his income is between 3 lac and 5 lac, then his tax-rate is 5% of hissalary; for the next 5 lac, tax-rate is 6%, for the next 10 lac tax is 7%, afterwards it is 8%.For e.g., if a person’s income is 22 lac, then his total tax = Tk. 0.05 *5 lac + Tk. 0.06 * 5 lac +0.07*10 lac + 0.08 * 2 lac = Tk. 1.41 lac.Please write a C-program that first reads an integer representing the current population of the city, and that next reads a decimal number for the projected population growth as a percentage (either positive or negative). The program should then display the expected population of the city in a year as a whole number. By convention we will only consider "whole" people. So a population of 31.8 inhabitants will be considered as having 31 inhabitants. Example Input: 1237.0 Output: 131
- Write a C++ program that prompts the user to input three (3) integers: MM, DD, and YYYY. For example, 07 26 1998. The program will print the number of days elapsed from 01 January of that year, i.e. January 1st is always 1 and December 31 is either 365 or 366, depending on if leap year or not.Write a C-program that converts metric measurements to imperial system values. Measurements are provided to your program in meters, grams or degrees Celsius and must be converted to feet, pounds and degrees Fahrenheit, respectively. Here are the conversion rules to use: 1 meter = 3.2808 feet; 1 gram = 0.002205 pounds; temperature in degrees Fahrenheit = 32 + 1.8 × temperature in degrees Celsius. On the first input line you are given the number of conversions to be made. Each of the following lines contains a value to be converted as well as its unit: m, g or c (for meters, grams or degrees Celsius). There will be a space between the number and the unit. You should print your output value for each input line immediately after calculating it (ie, you do not have to wait until you have read all inputs). Display the converted values with 6 decimal places, followed by a space and their unit: ft, lbs or f (for feet, pounds or degrees Fahrenheit). Each conversion result should be printed on…Make a C program Write a program that will calculate and print out bills for the city water company. The water rates vary depending on whether the water is for home use, commercial use or industrial use. A code of H means home use, a code for c means commercial use and a code of I means industrial use. The water rates are computed as follows: code H: P250.00 plus P0.002 per gallon used code c: P5,000.00 for the first 4 million gallons and P0.002 for each additional gallon. code I: P8,000 if usage is more than 4 million gallons but not moe that 10 million gallons and P18000 if usage exceeds 10 million gallons.
- Write a c++ program that asks the user to enter a number and then prints all the divisors of thatnumber. A divisor of an integer, also called a factor of , is an integer that can be multiplied bysome other integer to produce . An integer is divisible by another integer if is a factor of , so thatdividing by leaves no remainder. For example:Enter a number: 12The divisors of 12 are = 1, 2, 3, 4, 6, 12Enter a number: 7The divisors of 7 are = 1, 7Write a C++ program that Ask user to enter an integer number and then determine whether the number is prime or not? Note: a number is prime that it is only divisible by 1 and itself. such as 3,5,7,13,..Write a C program that input a single letter and prints out the corresponding digits on the phone. The letters and digits on a phone are grouped following way. 2 = ABC 3 = DEF 4 = GHI 5 = JKL 6 = MNO 7 = PRS 8 = TUV 9 = WXY No digits corresponds to Q and Z. For these two letters, your program should prints a message indicating that they are not used on a phone.
- Write a C++ program that takes a 4-digit number from user as and input and displays all the combinations of those digits.For Example: Enter number: 5321Possible Combinations are:5321, 5312, 5231, 5213, 5123, 5132 3521, 3512, 3251, 3215, 3125, 31521523, 1532, 1253, 1235, 1325, 1352 2513, 2531, 2153, 2135, 2315, 2351Write a C++ program that (1) asks the user to input a year number expressed in theRoman notation, (2) validates whether it is an existing and valid Roman number (i.e. (a)whether it does not consist of letters other than IVXCM, and (b) it does not have morethan three such letters appearing one after the other) – if it is invalid for a reason (c) theprogram should issue a warning but still carry out the further processing, then (3) convertsthis year number into an ARABIC year number (for example it converts the yearexpressed as a ROMAN number (MCMXCIX) into Arabic 1999), and finally (4) displaysthe Arabic equivalent of this year.Hint: To achieve such a conversion, you need to know rules of formulation of Romannumbers. These rules are as follows:(1) Roman numbers are based on sum (or difference) of its components. They use thefollowing components: M = 1000,D = 500,C = 100,L = 50X = 10,V = 5,I = 1; (2) When a smaller component is placed in front of a larger component, it means that…Write a C++ program that accepts a positive integer (orstring) as input and then displays a new number obtained by replacingevery pair of repeated adjacent digits by a single digit. For example,the integer 558834226 has three repeated adjacent digits: 55, 88 and 22.This means that your program should display the integer 583426 insteadof (558834226). You may assume that no digit is repeated more than twice.