91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

CSC1001代做、Python/Java程序設(shè)計(jì)代寫(xiě)

時(shí)間:2023-11-22  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



CSC1001: Introduction to Computer Science
Programming Methodology
Assignment 2
Assignment description:
This assignment will be worth 8% of the final grade.
You should write your code for each question in a .py file (please name it using
the question name, e.g. for question 1, name it q1.py). Please pack all your .py files into
a single .zip file, name it using your student ID (e.g. if your student ID is 123456, then
the file should be named as 123456.zip), and then submit the .zip file via Blackboard.
Please also write a text file, which provide the details about how to run your code for each
question. The text file should be included in the .zip file as well.
Please note that, the teaching assistant may ask you to explain the meaning of your
program, to ensure that the codes are indeed written by yourself. Please also note that we
may check whether your program is too similar to your fellow students’ code using
Blackboard.
This assignment is due on 5:00PM, 19 November (Sunday). For each day of late submission,
you will lose 10% of your mark in this assignment. If you submit more than three days later
than the deadline, you will receive zero in this assignment.
Question 1 (10% of this assignment):
(Math: approximate the square root) There are several techniques for implementing the
sqrt function in the math module. One such technique is known as the Babylonian
function. It approximates the square root of a number, n, by repeatedly performing a
calculation using the following formula:
nextGuess = (lastGuess + (n / lastGuess)) / 2
When nextGuess and lastGuess are almost identical, nextGuess is the approximated
square root. The initial guess can be any positive value (e.g., 1). This value will be the
starting value for lastGuess. If the difference between nextGuess and lastGuessis less than
a very small number, such as 0.0001, you can claim that nextGuess is the approximated
square root of n. If not, nextGuess becomes lastGuess and the approximation process
continues. Implement the following function that returns the square root of n.
def sqrt(n):
Question 2 (15% of this assignment):
(Emirp) An emirp (prime spelled backward) is a nonpalindromic prime number whose
reversal is also a prime. For example, both 17 and 71 are prime numbers, so 17 and 71 are
emirps. Write a program that displays the first 100 emirps. Display 10 numbers per line
and align the numbers properly, as follows:
Question 3 (15% of this assignment):
(Financial: credit card number validation) Credit card numbers follow certain patterns: It
must have between 13 and 16 digits, and the number must start with:
■ 4 for Visa cards
■ 5 for MasterCard credit cards
■ 37 for American Express cards
■ 6 for Discover cards
In 1954, Hans Luhn of IBM proposed an algorithm for validating credit card numbers. The
algorithm is useful to determine whether a card number is entered correctly or whether
a credit card is scanned correctly by a scanner. Credit card numbers are generated
following this validity check, commonly known as the Luhn check or the Mod 10 check,
which can be described as follows (for illustration, consider the card number
4388576018402626):
1. Double every second digit from right to left. If doubling of a digit results in a
twodigit number, add up the two digits to get a single-digit number.
2. Now add all single-digit numbers from Step 1.
4 + 4 + 8 + 2 + 3 + 1 + 7 + 8 = 37
3. Add all digits in the odd places from right to left in the card number.
6 + 6 + 0 + 8 + 0 + 7 + 8 + 3 = 38
4. Sum the results from Steps 2 and 3.
37 + 38 = 75
5. If the result from Step 4 is divisible by 10, the card number is valid; otherwise, it is
invalid. For example, the number 4388576018402626 is invalid, but the number
4388576018410707 is valid.
Write a program that prompts the user to enter a credit card number as an integer. Display
whether the number is valid or invalid. Design your program to use the following functions:
Question 4 (15% of this assignment):
(Anagrams) Write a function that checks whether two words are anagrams. Two words
are anagrams if they contain the same letters. For example, silent and listen are anagrams.
The header of the function is:
def isAnagram(s1, s2):
(Hint: Obtain two lists for the two strings. Sort the lists and check if two lists are identical.)
Write a test program that prompts the user to enter two strings and, if they are anagrams,
displays is an anagram; otherwise, it displays is not an anagram.
Question 5 (20% of this assignment):
(Game: locker puzzle) A school has 100 lockers and 100 students. All lockers are closed on
the first day of school. As the students enter, the first student, denoted S1, opens every
locker. Then the second student, S2, begins with the second locker, denoted L2, and closes
every other locker. Student S3 begins with the third locker and changes every third locker
(closes it if it was open, and opens it if it was closed). Student S4 begins with locker L4 and
changes every fourth locker. Student S5 starts with L5 and changes every fifth locker, and
so on, until student S100 changes L100.
After all the students have passed through the building and changed the lockers, which
lockers are open? Write a program to find your answer.
(Hint: Use a list of 100 Boolean elements, each of which indicates whether a locker is open
(True) or closed (False). Initially, all lockers are closed.)
Question 6 (25% of this assignment):
(Game: Eight Queens) The classic Eight Queens puzzle is to place eight queens on a
chessboard such that no two queens can attack each other (i.e., no two queens are in the
same row, same column, or same diagonal). There are many possible solutions. Write a
program that displays one such solution. A sample output is shown below:
Note: you cannot just pre-define a solution and display it.
Please use algorithm to display a possible solution. 
加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:ISOM 3029 程序代做 Using C++
  • 下一篇:TELE9754代做、代寫(xiě)Python,c++編程
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷(xiāo)助手小象助手多多出評(píng)軟件
    2025年10月份更新拼多多改銷(xiāo)助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶(hù)要求/設(shè)計(jì)優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開(kāi)團(tuán)工具
    出評(píng) 開(kāi)團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線(xiàn)
    合肥機(jī)場(chǎng)巴士4號(hào)線(xiàn)
    合肥機(jī)場(chǎng)巴士3號(hào)線(xiàn)
    合肥機(jī)場(chǎng)巴士3號(hào)線(xiàn)
  • 短信驗(yàn)證碼 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    精品国精品国产| 日韩av中文在线观看| 欧美成人官网二区| 在线观看亚洲a| 久久精品中文| 色婷婷激情综合| 色婷婷狠狠综合| 欧美这里有精品| 91精品国产入口在线| 日韩一区二区影院| 日韩情涩欧美日韩视频| 欧美大片国产精品| 欧美sm极限捆绑bd| 欧美激情中文不卡| 国产精品国产成人国产三级| 国产精品久99| 亚洲第一搞黄网站| 久久99这里只有精品| 国产精品一区二区在线观看网站| 国产jizzjizz一区二区| 99视频精品全部免费在线| 欧美日韩在线一区二区三区| 伊人影院久久| 久久av在线| 欧美精选一区二区| 亚洲一区欧美一区| 亚洲国产人成综合网站| 理论电影国产精品| 成人久久视频在线观看| 欧美精品99| 久久国产高清| 日韩女优视频免费观看| 亚洲欧洲一区二区在线播放| 午夜视黄欧洲亚洲| 国产乱子轮精品视频| 欧美日韩精品不卡| 美女尤物久久精品| 欧美mv日韩mv亚洲| 一区二区成人在线观看| 国产一区二区三区免费观看| 91蝌蚪porny成人天涯| 日韩网站在线| 7777精品伊人久久久大香线蕉经典版下载 | 国产美女在线精品免费观看| 日本道在线观看一区二区| 日韩欧美国产午夜精品| 亚洲男人天堂av| 精品在线免费观看| 国语自产精品视频在线看抢先版结局 | 精品视频1区2区3区| 久久免费的精品国产v∧| 一区二区三区四区蜜桃| 国产一区二区免费在线| 国外精品视频| 欧美福利一区二区| 有码一区二区三区| 国产1区2区3区精品美女| 国产三区精品| 久久综合久久久久88| 奇米四色…亚洲| 91蜜桃视频在线| 一本色道综合亚洲| 国产精品美日韩| 国产精品一区在线观看乱码| 一区二区精品| 久久久91精品国产一区二区精品 | 亚洲欧美经典视频| 久久婷婷亚洲| 国产婷婷色一区二区三区在线| 爽好久久久欧美精品| 国产一区亚洲| 日韩欧美高清dvd碟片| 日韩中文字幕一区二区三区| 国产精品久久| 精品国产成人在线影院| 六月丁香综合在线视频| 国产精品日韩二区| 国产精品毛片久久久久久| 国产99一区视频免费| 欧美综合一区二区三区| 一区二区三区欧美日韩| 91日韩在线专区| 日韩一级完整毛片| 免费成人美女在线观看.| 国产一区二区高清| 国产精品久久久久久妇女6080| 国产成人免费在线| 久久久www| 亚洲一区二区三区四区五区中文| 欧美少妇一区| 国产欧美日韩视频在线观看| 高清不卡一二三区| 欧美电影一区二区| 麻豆91在线播放免费| 色综合久久久久久久| 亚洲综合激情另类小说区| 国产综合欧美| 国产亚洲综合av| 91女人视频在线观看| 久久影院视频免费| 91免费看片在线观看| 国产亚洲自拍一区| 国产精品v欧美精品v日本精品动漫 | 国产精品xxx在线观看www| 欧美激情一区二区三区蜜桃视频 | 91在线观看美女| 国产欧美一区二区三区在线看蜜臀 | 老司机久久99久久精品播放免费| 日韩专区中文字幕一区二区| 色婷婷综合久久久久中文| 奇米一区二区三区| 欧美日韩免费在线视频| 精一区二区三区| 日韩西西人体444www| 99久久久免费精品国产一区二区| 久久久久久综合| 在线播放不卡| 亚洲成人第一页| 在线视频国内一区二区| 狠狠色狠狠色综合| www久久久久| 亚洲国产一区二区三区高清| 亚洲一区二区在线免费看| 色女孩综合影院| 国产成人精品亚洲777人妖| 26uuu国产电影一区二区| 国内精品99| 亚洲v精品v日韩v欧美v专区| 欧美在线观看一区二区| 成人激情视频网站| 亚洲同性同志一二三专区| 久久久777| 懂色av中文字幕一区二区三区 | 亚洲视频网在线直播| 久久av一区| 成人性生交大合| 亚洲欧美韩国综合色| 欧美午夜精品免费| 97久久精品人人爽人人爽蜜臀| 亚洲区小说区图片区qvod| 日本韩国精品在线| bt欧美亚洲午夜电影天堂| 亚洲日本va在线观看| 欧美日韩mp4| 韩日欧美一区| 久久丁香综合五月国产三级网站| 亚洲精品一区二区三区影院 | 亚洲综合丁香| 91在线国内视频| 五月激情综合网| 国产喂奶挤奶一区二区三区| 色狠狠一区二区三区香蕉| 99久久精品国产导航| 亚洲国产精品麻豆| 精品久久久久香蕉网| 国产精品日韩一区二区| 国产69精品久久777的优势| 亚洲精品久久久久久国产精华液| 欧美另类一区二区三区| 伊人久久大香线蕉综合热线| 国内精品伊人久久久久av影院 | 亚洲精品视频免费观看| 日韩一级片网站| 久久精品一区二区三区中文字幕| www.成人在线| 免费成人在线影院| 亚洲日本va午夜在线电影| 日韩一区二区电影在线| 久久先锋影音| 伊人成人在线视频| 成人午夜免费视频| 免费日韩伦理电影| 一区二区三区四区精品在线视频| 精品国产区一区| 在线观看国产一区二区| 亚洲日本黄色| 欧美精品国产一区二区| 国内精品伊人久久久久av影院 | 六月丁香婷婷久久| 亚洲国产aⅴ天堂久久| 国产精品毛片大码女人| 欧美岛国在线观看| 欧美日韩在线电影| 六月天综合网| 国产欧美日韩在线播放| 欧美日韩中文| 欧美成人一品| 97se亚洲国产综合自在线不卡 | 很黄很黄激情成人| 97久久精品人人做人人爽| 国产.欧美.日韩| 国产一区二区三区免费播放| 日本不卡不码高清免费观看| 亚洲主播在线播放| 亚洲人成影院在线观看| 中文字幕日本乱码精品影院| 欧美国产激情二区三区| 国产日韩欧美制服另类| 国产视频一区二区三区在线观看| 日韩你懂的在线播放|