The program is an illustration of loops.
Loops are used to perform repetitive actions.
The program in C++ where comments are used to explain each line, is as follows:
#include <string>
#include <iostream>
using namespace std;
int main(){
//This declares all variables
int n, count = 0; string k;
//This gets input for the number of cards
cin>>n;
//The following is repeated n-times
for(int i = 0;i <n;i++){
//This gets input for the current card value
cin>>k;
//If the card is a digit
if(isdigit(k[0])){
//This checks if the card number is between 2 and 6 (inclusive)
if(stoi(k) >= 2 && stoi(k) <= 6){
//If yes the face value is increased by 1
count+=1;
}
//This checks if the card number is 10
else if(stoi(k) == 10){
//If yes the face value is decreased by 1
count-=1;
}
}
//This checks if the card number is J, Q, K or A
else if (k == "J" || k == "Q" || k == "K" || k == "A") {
//If yes the face value is decreased by 1
count-=1;
}
}
//This prints the face value
cout<<count;
return 0;
}
At the end of the program, the face value is printed.
Read more about similar programs at:
https://brainly.com/question/24578223
Define a method calcPyramidVolume with double data type parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volume of a pyramid with a rectangular base. calcPyramidVolume() calls the given calcBaseArea() method in the calculation. Relevant geometry equations: Volume
Answer:
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
double baseLength = 0, baseWidth = 0, pyramidHeight = 0;
Object[] volume;
volume = calcPyramidVolume(baseLength, baseWidth, pyramidHeight);
}
public static Object[] calcPyramidVolume(double baseLength, double baseWidth, double pyramidHeight) {
double area = calcBaseArea(baseLength, baseWidth);
double volume = baseLength * baseWidth * pyramidHeight;
return new Object[]{volume, area};
}
public static double calcBaseArea(double length, double width) {
return length * width;
}
}
Explanation:
The problem is flawed because it is completely inefficient for one to create two separate methods to calculate the volume and the area when they can be done at once.
The second problem is that it was never specified whether to return something from the calcBaseArea method.
I assumed it required it, so it is not advisable to initiate the method as a double, but rather create it as an Object so that it can return two values: the volume and the area.
2.Is having the right tool imperative to successful completion of task at hand?
[tex]\huge\underline\mathtt\colorbox{cyan}{Yes}[/tex]
Having the right tool is imperative to successful completion of task at hand.
Classify the following as cross-section or time-series data: Gross sales of 200 ice cream parlors in July 2009
Answer:
let us start by stating the definitions of Time series data and Cross sectional data. TIME SERIES DATA: The data which is collected chronologically over time is known as time series data.
Explanation:
Btw brainliest me plss
What can you anticipate having to "give up or do" in order to attain the "things" you want?
There are many things to "give up or do" to attain the "things" you want. Some of them include giving up your time and your temporary pleasure.
Let assume you want to be successful in life, with money, family, and a good career; here are the things you can do to attain them:
Getting a good education to at least a degree level.Plan your life according to how you want it. If you want to become a medical doctor, study medicine and surgeryInvest in profitable business.Do both short-term and long-term investments.Save for rainy days.Acquire appreciable properties.Marry someone whose objective aligns with your goals in life, etc.Hence, in this case, it is concluded that to have what you want in life, it takes a plan, dedication, and willingness to go according to the set-out plan.
Learn more here: https://brainly.com/question/13132465
Why would you use a computer's secondary memory?
O A. To look at files created on your home computer on a public
computer
B. To run word processing software on your computer
O C. To save a slide show presentation on your computer
D. To start up your computer and perform its basic tasks
Answer:
I think B
Explanation:
Secondary storage is needed to keep programs and data long term. Secondary storage is non-volatile , long-term storage. Without secondary storage all programs and data would be lost the moment the computer is switched off.
A computer's secondary memory would be used to look at the files created on the home screen of the computer.
Option A is the correct answer.
A computer is an electronic device that is used to do various kinds of operations automatically.
Now, Secondary memory can be utilized to store the data or information which can be instantly recovered.
It is also known as backup memory. USB drives, hard disk drives, optical drives, etc. are some examples of secondary memory.
Therefore, the task of locating the files in the computer is to be done by using the computer's secondary memory. So option A is true.
Learn more about the secondary memory in the related link:
brainly.com/question/24901228
#SPJ6
What will the formula =SUM(J2:J10) do?
0 add the values in the row
O add 2 and 10 and put the sum in the column
0 add the values in cells J2 through J10
o add the values and put them in cell J2, J10
Microsoft Office Excel formulas operate on independent values and values in a range of cells or a cell.
The formula =SUM(J2:J10) will (c) add the values in cells J2 through J10
The formula is given as:
[tex]\mathbf{=SUM(J2:J10)}[/tex]
The above formula is a SUM function, and the syntax is:
[tex]\mathbf{=SUM([cell\_range])}[/tex]
This means that, [tex]\mathbf{=SUM(J2:J10)}[/tex] will add the values in cells J2, J3 up to cell J10
Hence, the correct option that describes the formula is:
(c) add 2 and 10 and put the sum in the column
Read more about Excel formulas at:
https://brainly.com/question/1285762
Answer:
tgzjfzfjstjs tv duh GG xogxpy distinctiveness sit sctggcfcv GG cc gghhbgvvggggghhhggggbbhhhhh c tjg0gpypy6ddf%24. Describe the role of keyboard and mouse in computer? What are the fundamental similarity and differences between them?
Answer: They give input
Explanation: The keyboard and the mouse controll the computer, by giving inputs. Similarity - They both give inputs
Difference - They give inputs in different ways
4. Identify which type of algorithmic operation each one of the following steps belongs to: a. Get a value for x from the user. b. Test to determine if x is positive. If not, tell the user that he or she has made a mistake. c. Take the cube root of x. d. Do Steps 1.1, 1.2, and 1.3 x times
Answer:
a. input/output
b. if/else statement
c. while loop
Explanation:
I don't know, sort of...
The percentages in the table represent the performance change from the previous month. Consider the impact of each metric on customer questions.
Metrics may be described as measures used to evaluate the performance or activity of seller, employee organization and so on. They help to better understand underlying factors or patterns which may be useful in making improvement in services.
Due to the influx of customer questions which is expected to have stopped after the promotional campaign. The company is trying to know why the questions keeps coming.
Based on the questions, the company used key subjects as metric in other to Analyse and address key issues resulted to the vendor which are shipping error , discount and delivery timeline.
Therefore, metrics allow to better measure and understand specific underlying patterns associated with businesses.
Learn more :https://brainly.com/question/25114661
Giúp mình với ạ . TG làm 1 h
[tex] \huge\green{here \: is \: your \: answer}[/tex]
We know that February has either 28 or 29 days, but there is a year in the future, February will have 30 days
What exactly is this year?
Answer:
39 days is the offensive number
Explanation:
cuz calendar no have that numer
Choose the statement that is true please help me fast like right now
A: It is estimated that 50% of the estimated 100 billion stars in the Milky Way galaxy have 5 or more planets.
B: The habitable zone is where stars and planets are not threatened by either supernovas exploding or from being swallowed by black holes.
C: The radial transit method of detecting star wobble registers the amount of red shift and blue shift and blue shift detectable in the star's movement as it moves away from us or towards us.
D: Exoplanets can be observed by the reflected light they give off from their star much the same way we can observe Mars, Venus and Jupiter.
Answer:
Exoplanets can be observed by the reflected light they give off from their star much the same way we can observe Mars, Venus and Jupiter.
Explanation:
Answer
D
Explanation:
I did this exam before trust me I don't care about points
Complete the following sentence by choosing from the options below. (select all that apply)
The main benefits of computers are their ability to:
save files
retrieve files
modify files
play DVDs
DONE
Answer:
Save files
Explanation:
The main benefit of a computer is to save files if there is no good storage the computer is bot complete
am i the only one that finds so much bots on peoples pages lol
full meaning of XP in computer
Answer → eXPerience
DUE SOON NEED HELP FAST!!
It is 6:30pm GMT, if it is 2:00PM where are you, what is your longitude?
Answer:
From 2007 to 2016 the correct answer would've been Caracas, Venezuela. With a longitude of 66° 56' W.
Their timezone at that time was GMT-4.5, which means they'd be four and a half hours behind GMT.
As of 2021, there are no countries using that timezone for international trade and travel.
Explanation:
Had to make some assumptions. If no other context is given, then this would be the correct answer.
A group of related classes is called a?
package. collection. attachment. archive.
A(n) package is the name for a collection of linked classes. A class field that depends on the values of other class fields should not be defined. To prevent having outdated info. Thus, option A is correct.
What package is a group of related classes?A group of related classes and interfaces are grouped under the namespace of a package. It is possible to think about packages as being similar to different computer directories.
A group of package parts is referred to as a package group. Package groups let you specify frequently connected elements as a single entity that you may associate with a rate code or a reservation.
A Bed and Breakfast package, which includes a room and breakfast service for a predetermined price, can serve as an illustration.
Therefore, make sure that just one class out of any multiple classes you define in a single Java file is public.
Learn more about package here:
https://brainly.com/question/15180292
#SPJ2
Not Answered 17.Not Answered 18.Not Answered 19.Not Answered 20.Not Answered Question Workspace Jessica wants to purchase a new hard drive. She wants a drive that has fast access because she will use it to edit videos on her PC. She also needs a lot of storage and wants to have at least 4 TB available to save her videos. Jessica wants to keep the cost down as much as possible possible. What type of hard drive should Jessica purchase?
Answer: HDD 7200RPM
Explanation:
a solid state drive is going to be so much money especially if its 4 TB so just get a HDD 7200RPM or even better if its higher revolutions per minute......
Technology and Communications Quiz Active 1 Which of the following inventions has had the greatest impact on sound technology? A. the extension cord
B. the tape recorder
c. the telegraph
d. the microphone
Answer:
B the tape recorder bec half century later made sonorities not only reproducible but also alterable.
The process of generating an image from a 2D or 3D model using computer programs is called ........
Answer:
endering or image synthesis is the process of generating a photorealistic or non-photorealistic image from a 2D or 3D model by means of a computer program. ... The term "rendering" is analogous to the concept of an artist's impression of a scene.
12zener diode is connected in a series with resistance of 150ohms a load resistance of 1kiloohms is connected across the zener diode the maximum zener current should not exceed 20mA and the minimum zener current is nearly zero .calculate the operating range of the input voltage?
Answer:
please answer my question by visiting my profile please I want it urgently
HELP ASAPPPP PLSSSSS!!!!!! The purpose of capillary tubes is to:
permit oxygen and nutrients to be absorbed by cells
allow blood to complete a path between arteries and veins
reverse the flow of blood
provide a means for cell wastes to enter the blood stream
Answer:
Permit oxygen and nutrients to be absorbed by cells
Explanation:
Because ,the capillaries arw the smallest of the blood vessels they act as a bridge between the two main..vessels
how does communication promotes team building
Answer:
Effective communication within a team will build a common purpose among team members that will allow them to reach their goals. ... Strong group communication will create understanding and that understanding will create powerful relationships within a team.
evolution of management
Answer:
Evolution of Management and Evolution of Management Science. ... Evolution of the management thought is a process that began in the earlier days of humans. It began when the man found the need to live in the groups. Then, mighty men soon organized the masses and distributed them among the groups.
Explanation:
HOPE IT HELPS
Your answer → - Evolution of management thought is a process that began in the earlier days of humans. -
Which statement is true about the storage media?
Group of answer choices
Data transfer rate of the inner tracks of a magnetic disk is higher than that of outer tracks.
Cost per bit in SSD is lower than that of a Magnetic tapes.
Cache memory is much faster than Magnetic disk storage. But it is much expensive than magnetic disks.
Magnetic disk storage is faster than SSD storage and hence it is a good candidate for a database that needs faster access time.
The statement which is true about storage media is "Cache memory is much faster than Magnetic disk storage. But it is much expensive than magnetic disks."
The cache memory is faster than both SDDs and HDDs. In mathematical terms, it is 4 time faster than SSDs and 80 times faster than HDDs. Moreover, it is more expensive then the SSDs and HDDs storage. Practically speaking, it is not good to have as much in-memory storage as persistent block storage on SSDs or HDDs.
The remaining statements are incorrect such as "Cost per bit in SSDs is lower than that of a Magnetic tapes". While truth be told the SSD cost more than the Magnetic Tapes.
Magnetic disk storage is faster than SSD storage and hence it is a good candidate for a database that needs faster access time. The statement is also incorrect as SSD are much faster than Magnetic Disk Storage.
Learn more in: https://brainly.com/question/25026748
Why did the spelling and grammar checkers in Word miss the errors highlighted in yellow?
please help, im vv confused
Answer:
I do believe that it is a grammar mistake.
Can people survive without technology?
As technology advances, does technology become more or less complex?
As technology advances, do the things we make, become: more reliable? Safer? More durable? Perform better?
As technology advances, does it require more or fewer science and math applications?
Answer:
1)Nowadays no one can survive without technology.
2)more complex
3) yes
4)yes ofc
Given a list of twenty number count the numbers among the list
Answer:
Thank you for the points<33
Could some please answer the question in the pictures? Thank you!! I will also give your brainliest if you give me the right answers!!
Answer:
1
Explanation:
per page must have 1 body
Please help. I don't know how to do this.
Answer: I need to know what the problem is tho.
Explanation: (0L0)