(a) The length of a month varies from 28 to 31 days. In this task you are required to create a program that reads the name of a month from the user as a string. Then your program should display the number of days in that month. Display '28 or 29 days' for February so that leap years are addressed.
Q: Write the C++ code for printing a series of numbers from starting number X and ending number Y. The…
A: A C++ program is as follows, File name: “main.cpp” #include <iostream> using namespace std;…
Q: Exercise 2. Write a program that inputs three integer numbers from the keyboard and prints the sum,…
A: Step-1: Start Step-2: Declare and Input three float variables a,b,c Step-3: Calculate their sum…
Q: 8) Write a program that asks for the user’s name and then the program will output the last 4…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: 17. Write a program that calculates and print the numbers (from 0 to 10) and it squares and cubes.
A: Mathematically we know that square of a number is its multiplication by itself. For example if n is…
Q: Problem The program takes in two strings and display the larger string without using built-in…
A: Note: As the programming language is not mentioned. So we did the question using PYTHON programing…
Q: Lab p-1) Write a program that calculates the following math equation: |axb e a=30, b=23, c=13
A: 1)calculate first d=a*b 2)next calculate d/c into e 3)calculate f into square root of e using…
Q: Rewrite program 1 using getline function to read your name, so that the system can read and display…
A: I have given an answer in step 2.
Q: n a program, write the program's algorithm that calculates the sum of odd integers (T1) from 1 to N,…
A: I have provided code in step2
Q: Exercise 9: Write a program to calculate the area of a triangle given the length of its three sides…
A: I will be taking input from user all three sides and then refer below for code: import math…
Q: Write the following in C++ Allow the user to enter a string with up to 100 letters. Display the…
A: The below given C++ program will obey the following rubrics: Including necessary header files. In…
Q: Q1: Write a program that determines whether the input year is Leap or Simple, Where the leap year is…
A: //Program of leap year #include <stdio.h>int main() { int y; printf("Enter a year: ");…
Q: 4/A/Design a program to calculate the value of (H) from the equations according to the specified…
A: Here is the code in Python:
Q: Prompt the user to enter a string of maximum 100 characters. Note: the string can contain spaces.…
A: We can take string input in C using scanf(“%s”, str). But, it accepts string only until it finds…
Q: Use String methods and if statements to combine the two given String variables, word1 and word2…
A: The above question is solved in step 2:-
Q: Q4) Write program, to allow the user to enter the height, and width of any rectangle, and find the…
A: I have answered the question in step 2.
Q: Excercise2: write a program to print the name of day when entering the number of the day. (For…
A: Since you have not mentioned programming language I'm doing this in c++
Q: In some programming languages, strings are entered surrounded by either single or doublequotation…
A: In C language we never have string data type. String can be handled using the character arrays. The…
Q: ake input a string from
A: Required: a) Take input a string from user and check if the string contains two consecutive digits…
Q: If an initial block statement is used after a certain point, it will become invalid.
A: Initial block: An initial block cannot be synthesised or transformed into a hardware schematic…
Q: Write a program to check whether the given number is even or odd.
A: NOTE : As the question is not specific about the programming language to be used to write the code ,…
Q: ii) Read input the first name and last name from the user and store it in variables fName, IName.
A: Write a Python program to read input the first name and last name from the user and store it in…
Q: Write a program that displays the current year, month, and day using the time(0) function.
A: Answer: Program Plan Define function displayCurrentDate() for displaying the current date in a…
Q: 7. Read input a string from the user and compute the sum of the count of characters '(' and ')' in…
A: #include <iostream> #include <conio.h> #include <stdio.h> using namespace std; int…
Q: Write a Program to find all Roots of a Quadratic Equation
A: a,b, c are coefficients where x can be calculayed by: x = [-b +- (b^2 - 4ac)^1/2] /2a D = b^2-4ac is…
Q: Write a python function that takes a string as an argument. Your task is to calculate the number of…
A: Task :- Write a python program to count the uppercase and lowercase letters in given string.…
Q: Q1- Write a program to enter any three numbers, then fınd their summation and the average.
A: "Since you have not mention any programming language, so we will write our program in C++ language."…
Q: Using C language, write code that solves the following problem. Have the user enter a string that…
A: #include<iostream>#include<string>using namespace std;int main(){ string s;…
Q: Swap the second and second last character of the string given below using a C++ program and print…
A: Given String: "Question2" Requirement: Write a program in C++ to swap the second and second last…
Q: 8. The dynamics of a comet is governed by the gravitational force between the comet and the Sun, f=…
A:
Q: Exercise 6: Write a program that asks the user to enter number and read it. Then display the content…
A: As the programming language is not mentioned so I am writing a code in C++ language. If you want a…
Q: Q2] write a program calculates the value of( Q)from the following series x3 Q= 1+7 x+ + + ... 3! 4!…
A: #include <math.h>#include <stdio.h> double sum(int x, int n){ double i, total = 1.0;…
Q: This program accepts the height of a person in centimeter and categorise the person according * .to…
A: A. 1-ElseIf((p >= 150) And (p < 165)) Then 2-ElseIf((p >= 165) And (p <= 195)) Then…
Q: 3. Write a program to read 20 integer numbers, each number consist of 3 digits, then find the number…
A: // Taking 20 numbers of three digits and storing them to a list numbers = [] for i in range(20):…
Q: Exercise 3 Problem Write a program that accepts input from the user. Create another string that…
A: logic:- read a string from user and store in str1 set str2=‘’ iterate for each i in str1 if…
Q: Q7 Draw the flowchart and write a C program using else if to calculate the total amount to be paid…
A: The program prompts the user to enter basic loan amount and number of years. Basic loan amount is…
Q: Complete a program for counting digits and displaying their total count at the end of the program }
A: Complete code: #include <iostream>using namespace std;int main(){int n;int digits = 0;cin…
Q: Exercise 1:1 write a program that reads three variables of real type, and then prints in ascending…
A: write a program that reads three variables of real type, and then prints in ascending order.
Q: Question 4 Complete the following program to input some characters from keyboard (Until the input…
A: #include<stdio.h>int letters(char *ch){ int c=0; for(int i=0;ch[i]!='\0';i++) {…
Q: Q1;- write c++ program to read an integer number and check if it is positive or * ? negative إجابتك…
A: Question 1 Answer: #include<iostream> using namespace std; int main() { int number; cout…
Q: 2. A color code is in form of a string in which the first three characters are the code for the…
A: The solution to the given problem is below.
Q: (c) You are required to create a program that reads a letter of the alphabet from the user. If the…
A: We want to check if the letter input is vowel or not, for y we have added a check, and printed…
Q: Exercise 5: Fix the errors in the given program Z=x*y; # include using namespace std; int main ()…
A: Please find the answer below :
Q: 2. Write a program to read a number. If the number is a multiple of 3, then enter three new numbers…
A: Question 2 is given below
Q: Change this c++ coding from output average and highest score to lowest score and second lowest…
A: Approach: Here, we use two 1-d arrays: one integer array to hold student scores and another string…
Q: How can I find the Pseudocodes and C++ codes for this problem?
A: The program defines an array called name of type string which have size 10. A for loop is used to…
Q: Question 5) Answer A and B. A- Write a program to check the entered number by user whether it is…
A: A number is said to be positive if the number is greater than or equal to 1. Similarly, a number is…
Q: 2- Write a program to enter(15) numbers by using inputbox function and then find the average of…
A: 1. declare two functions textbox and input box.2. in inputbox function take the 15 numbers from…
Q: 2. Complete the C++ function given below, string filterDigits(string text){ //remove all digits from…
A: Iterate through the characters one by one Add one flag to point to the current position of the…
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- (Conversion) a. Write a C++ program to convert meters to feet. The program should request the starting meter value, the number of conversions to be made, and the increment between metric values. The display should have appropriate headings and list the meters and the corresponding feet value. If the number of iterations is greater than 10, have your program substitute a default increment of 10. Use the relationship that 1 meter = 3.281 feet. b. Run the program written in Exercise 6a on a computer. Verify that your program begins at the correct starting meter value and contains the exact number of conversions specified in your input data. c. Modify the program written in Exercise 6a to request the starting meter value, the ending meter value, and the increment. Instead of the condition checking for a fixed count, the condition checks for the ending meter value. If the number of iterations is greater than 20, have your program substitute a default increment of (ending value - starting value) / 19.17. Redo Programming Exercise 16 so that the user can also input the cost of producing one liter of milk and the profit on each carton of milk.15. Write a program to implement and test the algorithm that you designed for Exercise 15 of Chapter 1. (You may assume that the value of . In your program, declare a named constant PI to store this value.)
- (Physics) Buoyancy is the upward force a liquid exerts on a submerged object, as shown in Figure 6.9. The buoyancy force is given by this formula: B=pgV Bisthebuoyancyforce( lbforN).isthefluiddensity( slug/f t 3 orkg/ m 3 ).gistheaccelerationcausedbygravity( 32.2ft/se c 2 or9.8m/ s 2 ).Vistheobjectsvolume( f t 3 or m 3 ). a. Using this formula, write a function named buoyantForce(double ro, double vol, int units) that accepts a fluid density, the volume of an object placed in the fluid, and the units to be used(1=U.S.Customaryunits,2=metricunits), and returns the buoyancy force exerted on the object. b. Include the function written for Exercise 6a in a working C++ program, and use your program to complete the following chart:(Misc. application) a. The data in the following chart was collected on a recent automobile trip: Write a C++ program that accepts a mileage and gallons value and calculates the miles pergallon (mpg) for that segment of the trip. The mpg is obtained as the difference in mileage between fill-ups divided by the number of gallons of gasoline used in the fill-up. b. Modify the program written for Exercise 9a to also compute and display the cumulative mpg after each fill-up. The cumulative mpg is calculated as the difference between the mileage at each fill-up and the mileage at the start of the trip divided by the sum of gallons used to that point in the trip.4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }
- change.py Create a program, change.py, that has a function that takes 5 arguments thatcorrespond to the number of $1 dollar bills, quarters, dimes, nickels, andpennies, respectively. Calculate the total value of that change, and print "Thetotal value of your change is $x" where x is equal to the total value.Please circle True or False for each of the following statements. C++ The return type void indicates that a function will perform a task but will not return any information upon completion of that task. TRUE FALSEQuestion 4 Write a C++ program that evaluates Ly=b and then Ux=y. L and U are the upper and lower triangular matrices of a square matrix A. b is a set of randomly generated numbers. Solve the equations to get the solution x. Full explain this question and text typing work only thanks
- Passwords, again Learning objectives In this lab, you will practice: writing a function to match the specifications using string concatenation to generate a new return value writing your code a module Instructions Write a function create_password(pet_name, fav_number) that will return a password with the following pattern: : fav_number followed by the pet_name followed by the underscore and fav_number (see example below). Create a program that reads pet name and favorite number from the user, uses the function above, and uses the return value to output: Your new password is "3Angel_3". Example Input: Angel 3 Output: Your new password is "3Angel_3". Note: Your program must define and call the following function: def create_password(pet_name, fav_number) # Define your function here. if __name__ == '__main__': # Type your code here.Passwords, again Learning objectives In this lab, you will practice: writing a function to match the specifications using string concatenation to generate a new return value writing your code a module Instructions Write a function create_password(pet_name, fav_number) that will return a password with the following pattern: : fav_number followed by the pet_name followed by the underscore and fav_number (see example below). Create a program that reads pet name and favorite number from the user, uses the function above, and uses the return value to output: Your new password is "3Angel_3". Example Input: Angel 3 Output: Your new password is "3Angel_3". Note: Your program must define and call the following function: def create_password(pet_name, fav_number) Wrong code below: #create function newPassworddef newPassword(petName, favouriteNumber): #return return favouriteNumber + petName + "_" + favouriteNumber if __name__ == '__main__': #enter your pet name…Passwords, again Learning objectives In this lab, you will practice: writing a function to match the specifications using string concatenation to generate a new return value writing your code a module Instructions Write a function create_password(pet_name, fav_number) that will return a password with the following pattern: : fav_number followed by the pet_name followed by the underscore and fav_number (see example below). Create a program that reads pet name and favorite number from the user, uses the function above, and uses the return value to output: Your new password is "3Angel_3". Example Input: Angel 3 Output: Your new password is "3Angel_3". Note: Your program must define and call the following function: def create_password(pet_name, fav_number)