Please give the answer in C++. Thank you.
Question 1 :
A. Assume character variable ch already has a value in it. Please write a boolean expression that will be true if ch is a lowercase alphabet letter.
B. Assume string variables word1 and word2 already have values in them. Please write a boolean expression that will be true if word1 would come AFTER word2 in a dictionary.
Note: Please write just expressions, NOT if statements! Please don't use ASCII codes for this question.
Question 2:
A. Please write a boolean expression that will be true when x is between 25 and 85 (including the values 25 and 85).
B. Please write a boolean expression that will be true when n1 is either less than n2 or is equal to 2020.
Note: Please write just expressions, not if statements!
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- Use C++arrow_forwardIn C++arrow_forward1. In using scanf the reference to data was always passed. When using printf the reference was passed for a string, but the data value was required for types such as integer. This says that what is commonly refer to as a variable actually has 3 parts: 1 - The label (sometimes called the id or name); 2 - the reference; 3 - the value. Explain to the best of your understanding what is the difference between each of these three parts, and how it changes the cognitive model or metaphor you use to understand a variable. The type of the variable (how the variable is stored and operations on the variable) are associated with what part of the variable, the label, reference, or value? 2. Which parts of the variable exist at compile time, and which parts exist at run time? 3. Harder question with more insight: Can a value be a reference? Can you think of an example? (Think of structs and arrays). 4. Even harder, this is a real world example. I read that Python has immutable primitive types (e.g.…arrow_forward
- Please read all parts and answer in C++. Do not provide an answer that was already used by other chegg experts. 1. The approach should be completely Object Oriented. I don't want to see STL map, parallel arrays, a long if/else if/else or switch statement.2. Prompt the user to enter a sentence. This means you must support whitespace in the string input. The sentence can have a maximum of 50 characters.3. Output the sentence character by character by translating the character into its Morse Code equivalent. You can print each on an individual line or on one line separated by a space.4. Use the Morse Code table as shown on Wikipedia. Represent with periods and hyphens. For example the character 'B' would be output as string "-..." 5. Morse Code is case insensitive meaning Morse Code treats 'a' and 'A' as the same character. You will need to handle this in your code.6. You can ignore any character in the sentence that is not a letter or number.7. Will not only be grading program…arrow_forwardLanguage- C++arrow_forwardProject 2: Truth Table: Write a program that displays the truth table for a proposition with two Boolean variables. Have a function for each operation Λ, V, and ~. in c++ with commentsarrow_forward
- Can you write a new code in C language with the values I sent you, just like this output? There are two files named group1.txt and group2.txt that contain course information and grades of each student for each class. I will calculate each course average for each group and show in simple bar graph. Use "*" and "#"characters for group1 and group2, respectively. I will see the number -999 at the end of each line in the input files. This value is used for line termination and you can use it to verify that you have arrived at the end of the line. The averages of each group should also be calculated and printed at the end of the file. Group 1: CSC 80 100 70 80 72 90 89 100 83 70 90 73 85 90 -999 ENG 80 90 80 94 90 74 78 63 83 80 90 -999 HIS 90 70 80 70 90 50 89 83 90 68 90 60 80 -999 MTH 74 80 75 89 90 73 90 82 74 90 84 100 90 79 -999 PHY 100 83 93 80 63 78 88 89 75 -999 Group 2: CSC 90 75 90 75 80 89 100 60 80 70 80 -999 ENG 80 80 70 68 70 78 80 90 90 76 -999 HIS 100 80 80 70 90 76 88 90…arrow_forwardIn C programming language. Objectives:• Use of functions and passing by value and reference.• Use of selection constructs.• Use of repetition constructs (loops).• The use of the random number generator and seeding.• Display formatted output using input/outputstatements.• Use format control strings to format text output. Description: For this project you are tasked with building a user application that will select sets of random numbers. Your application must use functions and pass values and pointers. Your program will pick sets of 6 random numbers with values of 1 to 53. The user should be able to choose how many sets to produce. The challenge will be to ensure that no number in a set of 6 numbers is a repeat. The number can be in another set just not a duplicate in the same set of 6. Your program should prompt the user and ask them how many number sets they wish to have generated. The program should not exit unless the user enters a value indicating they wish to quit. Minimum…arrow_forwardlanguage is c++arrow_forward
- C++ Languagearrow_forwardIn c++ is it possible to assign a string with two separate values?arrow_forwardIn C Programming Language Palindrome: “A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward, such as ‘madam’ or ‘kayak’” (excerpt from Wikipedia).Write a program that reads 8 words from Palindrome.txt and checks whether the word you read is a palindrome (please read its description above) or not. Print the index numbers of all the palindrome words in your array. You are required to read words character by character into a character array.• Write readFile function, which gets a file pointer and a two-dim array, to read each word(bunch of characters) line by line and store them into a two-dim character array.• Write findSize function takes a one-dim array and returns its actual size.• Write isPalindrome function takes a one-dim character array to check whether the content is a polindrome or not. If the word (character squence) is a palindrome, then it returns 1. Otherwise, it returns 0.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr